Jump to content

capturing date user last clicks a link


Smudly

Recommended Posts

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).

 

<?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.

Link to comment
https://forums.phpfreaks.com/topic/204439-capturing-date-user-last-clicks-a-link/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.