Re: Hopiing for some leads as to what may be wrong in this code [message #182255 is a reply to message #182248] |
Thu, 25 July 2013 17:51 |
Christoph Michael Bec
Messages: 207 Registered: June 2013
Karma:
|
Senior Member |
|
|
Twayne wrote:
> $code= $_POST["code"];
> if($_SESSION["d"] !== $code) {
> echo "<br />You did not enter the correct code: Script halted, ALL
> data destroyed.<br /> you'll have to go back to the website and start
> over.<br />";
> die("Script HALTED, data destroyed");
> session_destroy();
> exit();
> }
You may consider checking the actual values of $code and $_SESSION['d']
immediately before the if statement (if you don't have a debugger at
hand, just use a simple var_dump()).
BTW: calling session_destroy() after die() was executed doesn't have any
effect. You'll want to swap both lines and remove the exit().
--
Christoph M. Becker
|
|
|