PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
include ( "defaults.php" );
include ( "connect.php" );
$r=mysql_query("SELECT www, webcounter FROM $db_users WHERE selector=$_GET[ID]") or die
(mysql_error());
$f=mysql_fetch_array($r);
$f[webcounter]++;
mysql_query("UPDATE $db_users SET webcounter=$f[webcounter] WHERE selector=$_GET[ID]")
or die (mysql_error());
header("Location:$f[www]");
mysql_close();
exit();
?>
Hey, Im running PHP mydirectory and when a link is clicked to run out.php it will update that someone clicked the link in the MYSQL database but won't show the link, just: http://www.mysite.com/dir/out.php?ID=1
If I swap header("Location:$f[www]"); for echo "$f[www]"; it will display the link the so theres no problem retrieving that, thus the problem must be with the header and location command. Any way round this?? Many thanks...
In case that php every brings out a keyword that matches what you have in the array indices. If its unquoted then php will assume that your refering to the keyword and not the array indices.
or referring to a constant, which causes it to waste time searching through the variable space looking for a name, then sending a notice to the logs that it didn't find it.. Plus there have been a few instances where not quoting a string caused the bug in question.