Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10207

Re: Hopiing for some leads as to what may be wrong in this code

From Twayne <nobody@spamcop.net>
Newsgroups comp.lang.php
Subject Re: Hopiing for some leads as to what may be wrong in this code
Date 2013-07-25 14:11 -0400
Organization Aioe.org NNTP Server
Message-ID <ksrpol$9me$1@speranza.aioe.org> (permalink)
References <kspnth$vnb$1@speranza.aioe.org> <51f1653b$0$6627$9b4e6d93@newsspool2.arcor-online.net>

Show all headers | View raw


On 2013-07-25 1:51 PM, Christoph Michael Becker wrote:
> 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()).

It's interesting, but I did.  A rev back I had an echo for "code" and 
Session(... and it prints them just before it throws the error message.
>
> BTW: calling session_destroy() after die() was executed doesn't have any
> effect.  You'll want to swap both lines and remove the exit().
>

THAT is wise advice!  Thanks I'll do just that; thanks for pointing it out.

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Hopiing for some leads as to what may be wrong in this code Twayne <nobody@spamcop.net> - 2013-07-24 19:27 -0400
  Re: Hopiing for some leads as to what may be wrong in this code Jerry Stuckle <jstucklex@attglobal.net> - 2013-07-24 23:04 -0400
    Re: Hopiing for some leads as to what may be wrong in this code Twayne <nobody@spamcop.net> - 2013-07-25 13:39 -0400
    Re: Hopiing for some leads as to what may be wrong in this code Twayne <nobody@spamcop.net> - 2013-08-04 16:24 -0400
      Re: Hopiing for some leads as to what may be wrong in this code Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-04 22:08 -0400
  Re: Hopiing for some leads as to what may be wrong in this code Scott Johnson <noonehome@chalupasworld.com> - 2013-07-24 20:42 -0700
    Re: Hopiing for some leads as to what may be wrong in this code Twayne <nobody@spamcop.net> - 2013-07-25 13:37 -0400
  Re: Hopiing for some leads as to what may be wrong in this code The Natural Philosopher <tnp@invalid.invalid> - 2013-07-25 09:28 +0100
    Re: Hopiing for some leads as to what may be wrong in this code Twayne <nobody@spamcop.net> - 2013-07-25 13:24 -0400
      Re: Hopiing for some leads as to what may be wrong in this code The Natural Philosopher <tnp@invalid.invalid> - 2013-07-25 19:18 +0100
  Re: Hopiing for some leads as to what may be wrong in this code Christoph Michael Becker <cmbecker69@arcor.de> - 2013-07-25 19:51 +0200
    Re: Hopiing for some leads as to what may be wrong in this code Twayne <nobody@spamcop.net> - 2013-07-25 14:11 -0400
      Re: Hopiing for some leads as to what may be wrong in this code Christoph Michael Becker <cmbecker69@arcor.de> - 2013-07-25 20:31 +0200
      Re: Hopiing for some leads as to what may be wrong in this code Norman Peelman <npeelman@cfl.rr.com> - 2013-07-25 20:37 -0400
        Re: Hopiing for some leads as to what may be wrong in this code Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-07-27 12:17 +0200
          Re: Hopiing for some leads as to what may be wrong in this code Fiver <numeralfive@gmail.com> - 2013-07-28 07:01 +0200
            Re: Hopiing for some leads as to what may be wrong in this code Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-07-28 17:48 +0200
              Re: Hopiing for some leads as to what may be wrong in this code The Natural Philosopher <tnp@invalid.invalid> - 2013-07-28 19:17 +0100
    Re: Hopiing for some leads as to what may be wrong in this code Twayne <nobody@spamcop.net> - 2013-07-25 14:24 -0400
  RESOLVED Re: Hopiing for some leads as to what may be wrong in this code Twayne <nobody@spamcop.net> - 2013-07-27 11:05 -0400

csiph-web