Jump to content


One Time View


1 reply to this topic

#1 Tyriell

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 20 September 2005 - 12:18 PM

Hey all,
I've been trying to find a tutorial and doing trial and error scripting to try and figure out how to create a page that is only view on a visitors first visit to my site and then they don't see it again. It's for a warning/disclaimer at the entrance to my website, but I don't want my visitors to have to view that page EVERY time they enter my site.

The code I'm trying to get it to work with is:

$choose = ($_POST['choose']);

// If they do accept..
if ($choose == 'yes')
{
header("Refresh: 2; URL=main.php");
echo " "; }

// If they do not choose..
elseif ($choose == '')
{

echo 'Sorry, you must choose "yes" or "no" to be able to continue on to the site or leave by this method.<br />';
echo '<a href="javascript:history.back(1)">Try again</a>.';

}

// If they do not accept..
else
{
header("Refresh: 20; URL=http://www.google.com/");
echo "You are now being redirected to a safer website. Please wait...<br /><br /><br />

Although we are very sad to see that you will not be joining our fun, we appreciate that you actually took the time to read and understand our warnings. Here's hoping you surf across something more accommodating to your needs. <br /><br /> Thanks for stopping in,<br />The Management."; // NN4 requires that we output something...
exit(); }

If anyone has any ideas are actually knows how to do this, I would certainly appreciate the advice/help.

Thanks,
Tyr.

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 20 September 2005 - 03:25 PM

Try setting a cookie that says they've viewed that page, or record their ip into a database, and use that to see if they've already been there.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users