Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Found out he problem the ip address was not in quotes now it is fixed
i have an IP logger that i have built upon. But i dont want it to log me so i changed the script fromCode: Select all
<?
$filename = "counter.txt";
$filename2= "iplog.txt";
$item = $_POST['ghuta'];
$fp = fopen( $filename,"r");
$Old = fread($fp, 100);
fclose( $fp );
$Old = split ("=", $Old, 5);
$NewCount = $Old[1] + '1';
$New = "counter=$NewCount";
$fp = fopen( $filename,"w+");
if (flock($fp, 2)) {
fwrite($fp, $New, 100); }
fclose( $fp );
print "counter=$NewCount";
$fp = fopen( $filename2,"a");
$string = "\r\nVisitor Number-$NewCount IP Address-$item";
$write = fputs($fp, $string);
fclose($fp);
?>and i get
Code: Select all
counter=13so i changed it to
Code: Select all
<?
$filename = "counter.txt";
$filename2= "iplog.txt";
$item = $_POST['ghuta'];
if ( $item == my ip address ) {
$item= "I Visited My Own Site";
$fp = fopen( $filename2,"a");
$string = "\r\nVisitor Number-$NewCount $item";
$write = fputs($fp, $string);
fclose($fp);
} else {
$fp = fopen( $filename,"r");
$Old = fread($fp, 100);
fclose( $fp );
$Old = split ("=", $Old, 5);
$NewCount = $Old[1] + '1';
$New = "counter=$NewCount";
$fp = fopen( $filename,"w+");
if (flock($fp, 2)) {
fwrite($fp, $New, 100); }
fclose( $fp );
print "counter=$NewCount";
$fp = fopen( $filename2,"a");
$string = "\r\nVisitor Number-$NewCount IP Address-$item";
$write = fputs($fp, $string);
fclose($fp);
}
?>Code: Select all
Parse error: syntax error, unexpected T_DNUMBER in /home/www/neohosting.awardspace.co.uk/ip/counter.php on line 5and i dont understand why
if you want to see the flash here is a link http://neohosting.awardspace.co.uk/ip/get.html (that is the working one)
and here is the broken one http://neohosting.awardspace.co.uk/ip/broke.html
can someone please explain why the top one doesn't work
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]