December 18th, 2012, 10:56 AM
Php script that will check for cookie,if cookie yes go to url, if no run script
Im trying to create a php script that will check for cookie. If cookie exist it goes to a page. If the cookie does not exist it it will run script.
1. User visits index.php. seeing no cookie runs a script that directs user to gateway.php.
2. Gateway.php page places cookie.
3. User then picks between 2 options one of witch is the page he was just on.
4. If user picks this option the script does not run because it sees cookie avoiding infinity loop.
5. I only want to use php. Im trying to not use java script or anything.
$value = "mobilecookie";
How would I code this?
if cookie exist go to url(index.php)
if cookie does not exist run script once(script.php)
December 18th, 2012, 11:07 AM
please read the manual, especially the part on $_COOKIE.
But be aware that some people block cookies.
December 18th, 2012, 11:09 AM
Read the manual and give it a try.
I ♥ ManiacDan & requinix
This is a sig, and not necessarily
a comment on the OP:
don't be a help vampire