TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-14-2008, 04:19 PM   #1 (permalink)
The Contributor
Upcoming Programmer 
 
meshi's Avatar
 
Join Date: Oct 2007
Posts: 44
Thanks: 0
meshi is on a distinguished road
Default back button

hi all can u help me how to get rid of this error:

i try to put a back button on every page and this is my code:

PHP Code:
<input type="button" value="Back" onclick="history.back()" class="dtext"
its working but sometimes ill get this "Warning: Page has Expired".How to get rid of this warning?
meshi is offline  
Reply With Quote
Old 01-14-2008, 08:46 PM   #2 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

I suspect these expired pages are forms that you have submitted to your site? If so, this is a common problem with POST unfortunately.

Take a look at some of the google links below for solutions.

php post refresh - Google Search

Alan.
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 01-15-2008, 12:42 AM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

In a nutshell, the best way to go about this is to save all the data into hidden elements on the error page, and then have your back button post all that form data back via POST, and repopulate the text fields with that data. Obviously you'll want to invent a scheme where it is all automated, and you just put something like the following as the value for your form text field elements:

php Code:
echo $this->getPost('username');

So it's all automated up to a point, unless of course you want to use Javascript to make it 100% automatic, though this isn't recommended.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 01-15-2008, 11:44 AM   #4 (permalink)
The Contributor
Upcoming Programmer 
 
meshi's Avatar
 
Join Date: Oct 2007
Posts: 44
Thanks: 0
meshi is on a distinguished road
Default

i still dont understand...sory..could u please give me an example code...(procedural please i am not good in oop)
meshi is offline  
Reply With Quote
Old 01-15-2008, 12:47 PM   #5 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default

as well as the back button, try implementing the following:

Code:
<input type='hidden' method='POST' name='PostValueFromLastPage'>
And make sure that everything you posted to the page before the page you are on is carried over. This might cause some slowdown, but it is all I can think of. using GET would work if the code didn't need to be secure.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 01-15-2008, 03:14 PM   #6 (permalink)
The Addict
 
webtuto's Avatar
 
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
webtuto is on a distinguished road
Default

PHP Code:
<input type="button" value="Back" onclick="history.go(-1)" class="dtext"
try this
__________________
Send a message via MSN to webtuto Send a message via Yahoo to webtuto Send a message via Skype™ to webtuto
webtuto is offline  
Reply With Quote
Old 01-16-2008, 09:49 AM   #7 (permalink)
The Contributor
Upcoming Programmer 
 
meshi's Avatar
 
Join Date: Oct 2007
Posts: 44
Thanks: 0
meshi is on a distinguished road
Default

Quote:
<input type="button" value="Back" onclick="history.go(-1)" class="dtext">
i also tried that one webtuto but sometimes it also has a page expired
meshi is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:14 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design