Zen Follower
- Join Date:
- Apr 2008
- Location:
- Covington, Washington, United States
- Posts:
- 206
- Plugin Contributions:
- 0
Trying to use an age verification script, getting session problems..
OK, so I have an adult shop I am working on. I have a script that SEEMS to work, just not with zen cart... haha. I think for some reason zen-cart isn't allowing a separate session or something.
the zc store is located like in the following directory:
https://www.domain.com/store
in the root folder (store) I have the following .php file (verify.php)```php
<?php session_start(); if ($_REQUEST["over18"] == 1) { $_SESSION["over18"] = 1; header("Location: " . $_REQUEST["redirect"]); } ?> <html> <head> <title>Verify Your Age</title> </head> <body> <a href="/store/verify.php?over18=1&redirect=<?php echo $_REQUEST["redirect"]; ?>">I am over 18</a> | <a href="http://www.google.com/">Get me out of here!</a> </body> </html> ```Then I have the following in my includes/application_top.php file at the very end:
<?php
session_start();
if ($_SESSION["over18"] !=1) {
header("Location: /store/verify.php?redirect=" . $_SERVER['PHP_SELF']);
}
?>
I get the verify.php page to come up, but when clicking "I am over 18". It simply redirects back to the same page... What am I doing wrong? Please note that the script is in the application_top.php file so that this check populates whatever page the customer enters from, not just the homepage...
Contributions: Origin Based Drop-Shipping Mod, Download v1.0.1