Code: Select all
if (isset($pageurl)) {
$pageurl = $pageurl;
$_SESSION['pageurl'] = $pageurl;
} else if (isset($_SESSION['pageurl'])) {
$url = $_SESSION['pageurl'];
}Customer reaches a product page. URL is put in a session.
They click buy now, but because they are not logged in, they get asked to login or register.
If they click Register, they go to the registration page. By echoing $url on there, with the code above in the include file, it shows the URL is in that session.
Once they hit register it goes from /register (index.php?page=register) to login.php, which does all the DB checks, and logs them in. However, even if I strip out all that code, and just use the code above, and echo "$url";, it states:
[text]Notice: Undefined variable: url in C:\xampp\phpMyAdmin\site\login.php on line 11[/text]
Why does it store it in a session in the include files, but not in the *.php file??