okay, i keep getting the parse error:
Parse error: parse error, unexpected $end in e:\apache\htdocs\dafsplacev2\bin\counter.inc.php on line 44
I dont have a clue why, but i do know when i include anotherone it gives me this error:
Parse error: parse error, unexpected '}' in e:\apache\htdocs\dafsplacev2\bin\counter.inc.php on line 43
This is really annoying me as i cant figure it out! The script is for a counter with mysql tables dp_counter and dp_count, dp_counter keeps the ip with visit number, dp count just stores the amount of visits. Another Question, how do you color the code without going through each bit painstakingly coloring each bit?
<?php
include("config.inc.php");
include("vars.inc.php");
##################
Show Counter
##################
$sql1 = "SELECT count FROM dp_count WHERE row = 1";
$result1 = mysql_query($sql2)
or header("Location: ../index2.php?page=error&error=5");
while ($row1 = mysql_fetch_array($result1,MYSQL_ASSOC)) // line 10 //
{ // open brackets 1 //
extract($row2);
} // close brackets 1 //
##############
Check IP
##############
$sql = "SELECT * FROM dp_counter WHERE counterIP='$SERVER[REMOTE_ADDR]'";
$result = mysql_query($sql)
or header("Location: ./index2.php?page=error&error=5");
$num = mysql_num_rows($result); // line 20 //
if ($num) { // open brackets 2 //
// ip found //
$ip = "found";
} // close brackets 2 //
else { // open brackets 3 //
mysql_query("INSERT INTO dp_counter VALUES
counterIP = '$SERVER[REMOTE_ADDR]'")
or header("Location: ./index2.php?page=error&error=5");
$counter++;
mysql_query("UPDATE dp_count SET count = '$counter' WHERE row = 1") // line 30 //
or header("Location: ./index2.php?page=error&error=5");
##################
Show Counter
##################
$sql2 = "SELECT count FROM dp_count WHERE row = 1";
$result2 = mysql_query($sql2)
or header("Location: ./index2.php?page=error&error=5");
while ($row2 = mysql_fetch_array($result2,MYSQL_ASSOC))
{ // open brackets 4 //
extract($row2); // line 40 //
} // close brackets 4 //
} // close brackets 3 //
?>
Thanks for any effort made as its a tough one,
Daf.