Hi this is pretty noob stuff but here goes!
Ok so I have two
php files.
a.
php
b.
php
a.
php deals with some form validation, ending in
- Code: Select all
$worked = mail($to, $title, $message, $headers);
if($worked) {
$confmsg = '<p>Your request for a call back has been sent. A Cruise Specialist will be in touch.</p><p>You will now be redirected back to the page you were previously viewing. If the page does not load shortly please <a href="' . $prev . '">click here</a>.</p>';
// Insert monitor forwarder here
}
else {
// It failed
$confmsg = '<h1 class="first">Registration Problem</h1><p>There was a problem with your registration, please try again later.</p><p>You will now be redirected back to the page you were previously viewing. If the page does not load shortly please <a href="' . $prev . '">click here</a>.</p>';
}
?>
<?php session_start();
$_SESSION['$worked'] = $_POST['$worked'];
?>
Whilst b.
php takes the session checks to see if the mail has been sent and if so posts an echo like so:
- Code: Select all
<?php session_start();
$callback = $_SESSION['$worked']
?>
<?php
if ($callback) {
// Received new callback submission
$callmsg = '<p>We have received a new callback request</p>';
}
else {
//Did not recive new callback submission
$callmsg = '<p>There are no new callback requests</p>';
}
?>
<?php echo $callmsg; ?>
But it doesnt work??? Why is this? What am I not understanding about sessions?
Thanks in advance. eon201