Click Counter Question
I am trying to make a click counter, but ran into an issue that I can't seem to fix. I get this error when I try to go to clicks.php: "
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/bntqann/public_html/testing/click_counter/clicks.php on line 23"
Here is the code:
PHP Code:
<?php
// Get referreing link
$id = $_GET['id'];
// SQL Query
$sql = "SELECT * FROM `clicks` WHERE `id` = '$id'";
$result = mysql_query($sql) or die ('Error Getting Link! <br />' .mysql_error());
$row_count = mysql_num_rows($result);
while($row = mysql_fetch_array($result)) {
$count = "$row[count]";
$count++;
$sql = "UPDATE `clicks` SET `count` = '$count', `date` = '$date', `id` = '$row['id']' LIMIT 1";
$result = mysql_query($sql) or die ('Error Getting Link! <br />' .mysql_error());
}
if($row_count =< 1) {
header("Location: $url")
}
else {
echo 'Error sending you to the link location!';
}
?>
I am not sure why I got that error, hopefully someone will know
. Thanks in advance
Thanks DD, you saved me countless times
Bookmarks