-
Need some help Thx
Hi! all
is there a way make my php pages to visit first page first
like said i have this link on my site
www.example.com
www.example.com/index.php?id=news
www.example.com/topic.php
i want to make it they have to go www.example.com see main page before
they visit other two.
Thank you.
-
Re: Need some help Thx
The best way to do this is to use a session cookie to identify it. Cookies are set and retrieved as follows:
PHP Code:
setcookie ( 'visited', '1', 0); // setting a cookie
$visited = (bool) $_COOKIE['visited']; // getting a cookie (always cast)
You can check the cookie on your other pages to ensure the user has seen the index page. Why are you trying to do this, may I ask?
-
Re: Need some help Thx
Oh i'm trying to make so the read the agreement first.
thankx for your code
but really don't know much about the php
can you tell me more what i do with the code??
thankx alot
-
Re: Need some help Thx
You put it in a PHP script i.e:
index.php
PHP Code:
<?php
// this checks weather id is set and that the agreed cookie is set
if (isset($_GET['id']) && isset($_COOKIE['agreed'])) {
// display notice and exit
} else {
// continue
}