[PHP] Query regarding total count of pages in a site....
Hello, I need to find the number of webpages in a site.. is there any inbuilt variables in php to find it. Reply , if u have any valuable suggessions.. thanks. Suresh.P - Enjoy this Diwali with Y! India Click here
[PHP] Query regarding total count of pages in a site....
Hello, I need to find the number of webpages in a site.. is there any inbuilt variables to find it. Reply , if u have any valuable suggessions.. thanks. Suresh.P - Enjoy this Diwali with Y! India Click here
[PHP] help me in creating tables on the fly
hello friends, im currently working on creating musical forum. i need to create tables for every song uploaded on the fly to save the comments and rates entered by the viewers. im unable to create tables on the fly. can anyone know how to create tables on the fly .plz tell me . Also, can u tell me the way to how to play the song using php.. i uploaded the songs to mysql database... if u know the same kind of work anywhere in the net as tutorials and help .plza tell me the URL Thanks to all.. Suresh.P - Yahoo! India Matrimony: Find your partner now.
[PHP] query regerding copying files using php
hello friends, i have a query in writng the content of one file to another. i attempted it. it only writes the html codings.it could not write the php scripts inside the file. i use the following code to accomplish my problem... ## if (!defined('T_ML_COMMENT')) { define('T_ML_COMMENT', T_COMMENT); } else { define('T_DOC_COMMENT', T_ML_COMMENT); } $source = file_get_contents('-.php'); $tokens = token_get_all($source); foreach ($tokens as $token) { if (is_string($token)) { // simple 1-character token $ourFileName = "/home/itempla1/public_html/links/".$pwd.".php"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); echo $token; fwrite($ourFileHandle, $token); fclose($ourFileHandle); } else { // token array list($id, $text) = $token; switch ($id) { case T_COMMENT: case T_ML_COMMENT: // we've defined this case T_DOC_COMMENT: // and this // no action on comments break; default: // anything else -> output "as is" $ourFileName = "/home/itempla1/public_html/links/".$pwd.".php"; $ourFileHandle = fopen($ourFileName, 'a') or die("can't open file"); echo $text; fwrite($ourFileHandle, $text); fclose($ourFileHandle); break; } } } ?> please give me some valuable tips to write the content of the php file to another newly created php file. Thanks, Suresh.P - Yahoo! India Matrimony: Find your partner online.
[PHP] query regerding copying files using php
hello friends, i have a query in writng the content of one file to another. i attempted it. it only writes the html codings.it could not write the php scripts inside the file. i use the following code to accomplish my problem... ## if (!defined('T_ML_COMMENT')) { define('T_ML_COMMENT', T_COMMENT); } else { define('T_DOC_COMMENT', T_ML_COMMENT); } $source = file_get_contents('-.php'); $tokens = token_get_all($source); foreach ($tokens as $token) { if (is_string($token)) { // simple 1-character token $ourFileName = "/home/itempla1/public_html/links/".$pwd.".php"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); echo $token; fwrite($ourFileHandle, $token); fclose($ourFileHandle); } else { // token array list($id, $text) = $token; switch ($id) { case T_COMMENT: case T_ML_COMMENT: // we've defined this case T_DOC_COMMENT: // and this // no action on comments break; default: // anything else -> output "as is" $ourFileName = "/home/itempla1/public_html/links/".$pwd.".php"; $ourFileHandle = fopen($ourFileName, 'a') or die("can't open file"); echo $text; fwrite($ourFileHandle, $text); fclose($ourFileHandle); break; } } } ?> please give me some valuable tips to write the content of the php file to another newly created php file. Thanks, Suresh.P - Yahoo! India Matrimony: Find your partner now.
[PHP] query on traffic exchange script
hello, i have encountered in a problem while creating traffic exchange script. while running the script in SSN , it displays warning like strpos(); Empty delimeter. line 86. in rundaily.php i have attached the script file rundaily.php and logtraffic.php below plz, kindly check it and give me valuable suggestions over it... Thanks, Suresh.P Logtraffic.php http://","",$cDomain); $cDomain= str_replace("www.","",$cDomain); [EMAIL PROTECTED]($cDomain,"/"); if($a) $cDomain=substr($cDomain,0,$a); [EMAIL PROTECTED]($cDomain,"?"); if($a) $cDomain=substr($cDomain,0,$a); if(eregi("[a-z0-9-]+(\.[a-z0-9-]{1,})*\.([a-z]{2,}){1}$",$cDomain)) { $aBlock=explode(",",$Block_Domain); $maxBlock=count($aBlock); $stopit=0; if($maxBlock>0) { for($a=0;$a<$maxBlock;$a++) { if($aBlock[$a]==$cDomain) {$stopit=1; break;} } } if($stopit==0) { $cLog="$cDomain|$REMOTE_ADDR~ ".date("m/d/Y H:i")." | $HTTP_REFERER2 \n"; if(!file_exists("trafficlog.txt")) $fp=fopen("trafficlog.txt","w") or die("Error writing log"); else $fp=fopen("trafficlog.txt","a") or die("Error writing log"); flock($fp,2); fwrite($fp,$cLog); flock($fp,1); fclose($fp); } } } } //header('Content-type: image/jpeg'); ?> Rundaily.php "; } //REMOVE DUPLICATE IN ARRAY rsort($aT3); $nNewMax=$nMax-$n; array_splice($aT3, $nNewMax); // COUNT and make a final list of links $aAddDomain=str_replace("," , "|," , $Add_Domain)."|"; $aAddDomain=explode(",",$aAddDomain); $aT3=array_merge($aT3,$aAddDomain); $nNewMax=count($aT3); rsort($aT3); $i=strpos($aT3[$a],"|"); $cTmp=substr($aT3[$a],0,$i); $j=0; $aFinal=array(); for($a=0;$a<$nNewMax;$a++) { $i=strpos($aT3[$a],"|"); $aT3[$a]=substr($aT3[$a],0,$i); if($cTmp==$aT3[$a]) { $j++; } else { if($j>0) $aFinal[]=array($j,$cTmp); $cTmp=$aT3[$a]; $j=1; } } $aFinal[]=array($j,$cTmp); $nNewMax=count($aFinal); array_multisort($aFinal, SORT_DESC); // SPIDER LINKS AND GET TITLE if($total_title_links>0) { } //=== GET THE TEMPLATE AND REPLACE BY ACTUAL LINKS $cTmp=file_get_contents($template); if($AddParameter!="") {$aParam=explode(",",$AddParameter); $maxp=count($aParam);} for($a=0;$a<=100;$a++) { $b=$a+1; $ccode="@LINK$b@"; $ccode2="@TRAFFIC$b@"; if($a<$nNewMax) { $cFinalURL="http://www.".$aFinal[$a][1]; if(strpos($AddParameter,$aFinal[$a][1])!= false) { for($x=0;$x<$maxp;$x++) { if(strpos($aParam[$x],$aFinal[$a][1])!==false) {$cFinalURL="http://www.".$aParam[$x]; break;} } } $cFinalLink="".$aFinal[$a][1].""; $cTmp= str_replace($ccode,$cFinalLink,$cTmp); $cTmp= str_replace($ccode2,$aFinal[$a][0],$cTmp); } else { $cTmp= str_replace($ccode,"",$cTmp); $cTmp= str_replace($ccode2,"",$cTmp); } } $mycode="This Free Script is Powered by http://smallcapitalbusiness.com\";>SmallCapitalBusiness"; $cAddSite="Add Your Site$mycode"; $cTmp= str_replace("@ADDYOURSITE@",$cAddSite,$cTmp); $cTmp= str_replace("@TITLE@",$Title,$cTmp); //=== WRITE NEW LINKS //$cTmp="cTmp='$cTmp'; document.write(cTmp)"; //print $cTmp; $fp=fopen("mylinks.htm","w") or die("Error writing log"); flock($fp,2); fwrite($fp,$cTmp); flock($fp,1); fclose($fp); //== OVERWRITE TRAFFICLOG.TXT $fp=fopen("trafficlog.txt","w") or die("Error writing log"); fclose($fp); //= ADD SUMMARY TO NEWFILE $aprn=print_r($aFinal,TRUE); $newfile2="$prefix".date("m-d-Y",strtotime("-1 day")).".sum"; $fp=fopen($newfile2,"w") or die("Error writing log"); flock($fp,2); fwrite($fp,$aprn); flock($fp,1); fclose($fp); //$diff=time()-$starttime; //print date("G:i:s",$starttime)." = ".date("G:i:s")." = ".date("G:i:s",$diff); ?> - Yahoo! India Matrimony: Find your partner now.
RE: [PHP] Query - Warning: Cannot modify header information
i checked the line before 61... it sends the image content type this is the code of image.php | | All rights reserved.| +-+ | PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" | | FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE | | AT THE FOLLOWING URL: http://www.x-cart.com/license.php | | | | THIS AGREEMENT EXPRESSES THE TERMS AND CONDITIONS ON WHICH YOU MAY USE | | THIS SOFTWARE PROGRAM AND ASSOCIATED DOCUMENTATION THAT RUSLAN R. | | FAZLIEV (hereinafter referred to as "THE AUTHOR") IS FURNISHING OR MAKING | | AVAILABLE TO YOU WITH THIS AGREEMENT (COLLECTIVELY, THE "SOFTWARE"). | | PLEASE REVIEW THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT | | CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE. BY INSTALLING, | | COPYING OR OTHERWISE USING THE SOFTWARE, YOU AND YOUR COMPANY | | (COLLECTIVELY, "YOU") ARE ACCEPTING AND AGREEING TO THE TERMS OF THIS | | LICENSE AGREEMENT. IF YOUARE NOT WILLING TO BE BOUND BY THIS | | AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. VARIOUS COPYRIGHTS AND | | OTHER INTELLECTUAL PROPERTY RIGHTSPROTECT THE SOFTWARE. THIS | | AGREEMENT IS A LICENSE AGREEMENT THAT GIVES YOU LIMITED RIGHTS TO USE | | THE SOFTWARE AND NOT AN AGREEMENT FOR SALE OR FOR TRANSFER OF TITLE.| | THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT. | | | | The Initial Developer of the Original Code is Ruslan R. Fazliev | | Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2005 | | Ruslan R. Fazliev. All Rights Reserved. | +-+ \*/ # # $Id: image.php,v 1.28.2.1 2005/01/12 07:41:42 svowl Exp $ # # Show image by productid # require "./top.inc.php"; require "./config.php"; if (empty($productid)) $productid = ""; $image_out = ""; $image_type = ""; $image_path = ""; if (!empty($tmp)) { x_session_register("file_upload_data"); if (!empty($file_upload_data["file_path"]) && $file_upload_data["id"]==$productid && $file_upload_data["imtype"]=="T") { $image_out = func_file_get($file_upload_data["file_path"], true); } } if (empty($image_out)) { if(!empty($variantid)) $result = db_query("SELECT image, image_path, image_type FROM $sql_tbl[thumbnails] WHERE productid='$productid' AND variantid = '$variantid'"); if(empty($result)) $result = db_query("SELECT image, image_path, image_type FROM $sql_tbl[thumbnails] WHERE productid='$productid' AND variantid = ''"); if (db_num_rows($result)) list($image, $image_path, $image_type) = db_fetch_row($result); else { header("Content-type: image/gif"); func_readfile($default_image, true); exit; } db_free_result($result); if ($config["Images"]["thumbnails_location"] == "DB") { if (!empty($image)) $image_out = $image; else $no_image_db = true; } if ($config["Images"]["thumbnails_location"] == "FS" || !empty($no_image_db)) { if (!empty($image_path)) { header("Content-type: $image_type"); func_readfile($image_path, true); exit; } } } if (!empty($image_out)) { header("Content-type: $image_type"); echo $image_out; } else { header("Content-type: image/gif"); func_readfile($default_image, true); } ?> plz check it and give some valuable sugguesion to me. thanks.. George Pitcher <[EMAIL PROTECTED]> wrote: This looks as though you are trying to send header() after something has been output to screen. Check your code before line 61. George > -Original Message- > From: Suresh Pandian [mailto:[EMAIL PROTECTED] > Sent: 30 September 2005 7:47 am > To: php-general@lists.php.net > Subject: [PHP] Query - Warning: Cannot modify header information > > > Hi friends, > > i am currently redesign th x-cart site. ichanged the template > files into my concern. i received some warnings like this.. > > Warning: Cannot modify header information - headers already sent > by (output started at /home/gift1/public_html/home.php:2) in > /home/gift1/public_html/referer.php on line 61 > > > > > > The images in the database also not displayed.but, i didnot > change anything in the image.php. > > > > how can i solve this .i need help asap > > > - > Yahoo! India Matrimony: Find your partner now. - Yahoo! India Matrimony: Find your partner now.
[PHP] Query - Warning: Cannot modify header information
Hi friends, i am currently redesign th x-cart site. ichanged the template files into my concern. i received some warnings like this.. Warning: Cannot modify header information - headers already sent by (output started at /home/gift1/public_html/home.php:2) in /home/gift1/public_html/referer.php on line 61 The images in the database also not displayed.but, i didnot change anything in the image.php. how can i solve this .i need help asap - Yahoo! India Matrimony: Find your partner now.
[PHP] query in php
respected sir, i have a query about how to open a audio file and upload as well as download in a website using php. plz send me a tutorial help related to it. thanks Suresh.P - Yahoo! India Matrimony: Find your partner now.