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 <?php global $REMOTE_ADDR; global $HTTP_REFERER; include("xconfig.php"); if(isset($HTTP_REFERER2) && strpos($HTTP_REFERER,$MyDomain) !== false) { if(strpos($HTTP_REFERER2,$MyDomain) === false) { $cDomain=strtolower($HTTP_REFERER2); $cDomain= str_replace("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 <?php //$starttime=time(); include("xconfig.php"); if(!file_exists("trafficlog.txt")) exit; $aT=file("trafficlog.txt"); $newfile="$prefix".date("m-d-Y",strtotime("-1 day")).".dat"; copy ("trafficlog.txt",$newfile); $nMax=count($aT); $aT3=array(); //======= GET ONLY THE DOMAIN AND IP for($a=0;$a<$nMax;$a++) { $i=strpos($aT[$a],"~"); $aT3[]=substr($aT[$a],0,$i); } sort($aT3); // ==== REMOVE DUPLICATES $n=0; for($a=0;$a<$nMax;$a++) { if($aT3[$a]==$aT3[$a+1]) {$aT3[$a]="0"; $n++;} //print $aT3[$a]." = ".$aT3[$b]."<br>"; }
//========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="<a href=\"$cFinalURL\">".$aFinal[$a][1]."</a>"; $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="<br><p align=\"right\"><font size=\"1\">This Free Script is Powered by <a href=\"SmallCapitalBusiness http://smallcapitalbusiness.com\">SmallCapitalBusiness</a></font></p>"; $cAddSite="<a href=\"javascript:alert('$addyoursite')\">Add Your Site</a>$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.