Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2004, 09:12 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete variable permanently

Hi,

I have created a login page (PHP) which send the information to the next page (POST) - When the user has done the updates, I have a button : Logout with this:

Logout.php:
<?php
session_start();
session_destroy();
unset($_SESSION);
?>
<html><head><title></title>
<meta http-equiv="refresh" content="0; URL=http://www.webpage.com/">
<meta name="keywords" content="automatic redirection">

My problem is that if I click the "back" button 2 or 3 times in the browser, I return to the menu page and IE asked if I want to refresh; if I click refresh, the variables are still there??

How do I stop this?
 
Old December 11th, 2004, 10:53 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Got the reponse from a friend:
To permanently kill the variable used, place this lines:
session_destroy();
unset($_SESSION);
if(isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); }
 
Old December 14th, 2004, 07:57 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

to unset session, session_unset();
to transit session variables, to other page,
<a href="delete_page.php?<?php echo strip_tags(SID); ?>">next</a>

 
Old December 14th, 2004, 08:23 AM
Authorized User
 
Join Date: Oct 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to SiliconFuRy
Default

You also might wanna turn off caching for all pages that use the session, might help.

Many shoes,

Jamez/SiliconFuRy





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
php/mysql delete button and delete query dungey PHP Databases 17 April 11th, 2009 12:24 PM
ASSIGNING A JAVA SCRIPT VARIABLE TO A XSL VARIABLE SOMANATHAN10 XSLT 1 February 21st, 2007 04:26 AM
permanently delete straight away in Windows crmpicco HTML Code Clinic 2 October 7th, 2005 08:52 AM
how to delete a row when click delete hyperlink naveenkumarg1 Pro JSP 1 August 16th, 2004 01:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.