Jump to content

mibole

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mibole's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi I have an index.php file that looks like this: <?php $p = $_GET['p']; if(is_null($p)) { $p = 0; } include('connect.php'); //connects to database $IP = $HTTP_SERVER_VARS['REMOTE_ADDR']; $query = "INSERT INTO `visits` (`ip`, `page`) VALUES ('$IP', '$p')"; $result = mysql_query($query); mysql_close($connect); //Page redirection-------------------- if($p == 1 || $p == 0) { include('main.php'); } if($p == 2) { include('folio.php'); } ?> For some reason, the first time the page loads (where it should register p=0), it doesn't insert the data into the database. If I hit reload (F5), it does insert the data (with p=0). Has anyone an idea why this is happening? Any response is appreciated. Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.