NYCPHP Meetup

NYPHP.org

[nycphp-talk] Disabling browser back button.

tedd tedd at sperling.com
Sun Jun 22 16:13:51 EDT 2008


>Hi Tedd,
>Sorry to say it didn't work or at least I couldn't get it to work. 
>As you see the only thing I did was to tidy up the last 
>$_SESSION['token']. however I did try using True and False which 
>disabled me completely.
>
><?php session_start(); ob_start();
>    $token = isset($_SESSION['token']) ? $_SESSION['token'] : 0;
>      if ($token == 1)
>    {
>    exit();
>    }
>$_SESSION['token'] = 1;
>?>
>
><HTML><HEAD><TITLE>create account/access codes</TITLE></HEAD>
><BODY>
>
>Cheers - Paul


Paul:

It does work -- here's a working example:

http://webbytedd.com/bb/one-time/

You can only see it once per session and it uses exactly the code I posted.

You might take out that ob_start() and try it again.

Cheers,

tedd
-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the talk mailing list