capturing date user last clicks a link

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!

Moderator: General Moderators

Post Reply
Smudly
Forum Commoner
Posts: 71
Joined: Wed Jun 09, 2010 10:09 pm

capturing date user last clicks a link

Post by Smudly »

I am trying to capture the current date a user is on my website, but only when they click on a particular link (in this case, surf.php).

Code: Select all

<?php
	
$surf = $_GET['surf'];

if ($_SESSION['username'] != 'Admin')

echo "Welcome, ".$_SESSION['username']. "!<br /><a href='surf.php' name='surf'>Surf</a><br /><a href='sites.php'>Add Site</a><br /><a href='logout.php'>Logout</a>";
	if ($surf){
		include('inc/connect.php');
		$lastsurfed = date("Y-m-d");
		$currentdate = mysql_query("SELECT lastsurfed FROM users WHERE lastsurfed='$lastsurfed'");
		$datecount = mysql_num_rows($datecount);
		
	
	} 
	

else

	

	

echo "Welcome, ".$_SESSION['username']. "!<br /><a href='surf.php'>Surf</a><br /><a href='sites.php'>Add Site</a><br /><a href='logout.php'>Logout</a><br /><a href='admin/index.php'>Admin Area</a>";
} else

	

header("Location: index.php");


	
	?>
I must be doing something wrong. No errors are being returned. When clicking the link, it does not update the date inside my sql taable.
Post Reply