Jump to content
MakeWebGames

Last page view


peterisgb

Recommended Posts

i've been working on a little addon so that it shows the last page the user is on.

i used this code

 

global $db,$ir;
$db->query("UPDATE users SET lastpage='Users Online' WHERE userid=$userid");

 

but this means i'll have to put it on every page :( which will take forever.

so with that in mind i decided to put this code below in header.php

 

global $db,$ir;
$db->query("UPDATE users SET lastpage='".$_SERVER['PHP_SELF']."' WHERE userid=$userid");

 

Which works might i say but there is a little snag with it,

the first code is displays like this "Users Online" but using the PHP self code it comes out like this "/game/usersonline.php".

Is there a way to use the PHP SELF code but not display the whole link, but instead just the page that the user is on,

Thanks for any replys or help on this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...