:eek::eek:
My website has pages that require you to view one before you are able to view the next.
So, I'm trying to create a code that is User Specific, that when they view a page. Their entry for curentpage in my table updates. I don't want it to replace the previous one if they want to go back and view previous pages. I want to keep track of how far they have gone though. So far, this is what I have. I am new to php, so please excuse me if this is extremely simple.
update.php
<?php
session_start();
include ("config.php");
// current page will be called from each page, name of the page: toys, cars, soda, etc...
$user=$_SESSION['user']; //username or id
$query="update `users` set `lastpage`='$currentpage' where `user`='$user'";
$result=@mysql_query($query) or die(mysql_error());
?>
then on each .htm page I am going to do an include, to call up that previous code above.
<? php
$currentpage="toys";
include ("update.php");
?>
I want it to update though when the person visits the page. I attempted to do an onLoad command, however this didn't work for me.
Any suggestions or advice would be greatly appreciated.