473,385 Members | 1,267 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Preventing "Are you sure you want to resend POST data?" warnings

Hi

I need small help,

What I need is when I write a script to handle my post data on my login page. if login failed and i press refresh key browser shows msg to resend the post data

I tried unset() function too, But it didn't work. Do any one have
anything for me ?

Thanks In advance
Regards
Kaushal
Aug 21 '07 #1
6 7201
pbmods
5,821 Expert 4TB
Heya, Kaushal. Welcome to TSDN!

You posted this in the Articles section. I'll go ahead and move it to the Forum where an Expert will be more likely to find it.

Changed thread title to better describe the problem (did you know that threads whose titles that do not follow the Posting Guidelines actually get FEWER responses?).
Aug 21 '07 #2
Purple
404 Expert 256MB
Hi kiran Vidhate,

can you post the code you have already, it will make it simpler to assist if we can see what you have already.

Regards Purple
Aug 22 '07 #3
pbmods
5,821 Expert 4TB
Heya, Kaushal.

The way to prevent this is to use header() redirection. When the User submits the form, have the form submit to a *separate* page, and then use header() redirection to send him back when you are done.

How header() redirection works
Aug 22 '07 #4
Hi

I need small help,

What I need is when I write a script to handle my post data on my login page. if login failed and i press refresh key browser shows msg to resend the post data

I tried unset() function too, But it didn't work. Do any one have
anything for me ?

Thanks In advance
Regards
Kaushal
At the top of the page, after you have processed the data, try this:

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. session_start();
  3.    if(isset($_REQUEST['bla']))
  4.       {
  5.           process the code here, then...
  6.          echo "<script>
  7.                   document.location.href='thispage.url';
  8.                   </script>";
  9.          exit;
  10.       }
  11. ?>
  12.  
This will process the data, then redirect the user to the same page, without the posted data.
Aug 23 '07 #5
Atli
5,058 Expert 4TB
At the top of the page, after you have processed the data, try this:

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. session_start();
  3.    if(isset($_REQUEST['bla']))
  4.       {
  5.           process the code here, then...
  6.          echo "<script>
  7.                   document.location.href='thispage.url';
  8.                   </script>";
  9.          exit;
  10.       }
  11. ?>
  12.  
This will process the data, then redirect the user to the same page, without the posted data.
You can also swap the JavaScript with a header, like pbmods said.
Like so:
Expand|Select|Wrap|Line Numbers
  1. header("Location: thispage.url");
  2.  
Aug 23 '07 #6
You can also swap the JavaScript with a header, like pbmods said.
Like so:
Expand|Select|Wrap|Line Numbers
  1. header("Location: thispage.url");
  2.  
Oooh I like that one... I have not found that!
I'll try it out on my site.
Aug 23 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: MobilityB | last post by:
I am receiving this message when attempting to deploy to a CE5.0 device using VS 2005 Beta 2. Any suggestions on the cause and fix for this? Thanks, WB
12
by: Charlie Zender | last post by:
Hi, I am unable to compile a large body of code with extremely pedantic compile time checks activate, so that warnings cause errors. With GCC 3.3.1, I do this with gcc -std=c99 -pedantic...
4
by: ben | last post by:
has anyone got or read this book: robert sedgewick "algorithms in c parts 1-4"? i'm having an absolute nightmare with the book. amoung other things i'm trying to construct the necessary support...
6
by: kobu.selva | last post by:
I was recently part of a little debate on the issue of whether constants and string literals are considered "data objects" in C. I'm more confused now than before. I was always under the...
45
by: Gregory Petrosyan | last post by:
1) From 2.4.2 documentation: There are two new valid (semantic) forms for the raise statement: raise Class, instance raise instance 2) In python: >>> raise NameError Traceback (most recent...
23
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
13
by: Jen | last post by:
One user of my application is experiencing an exception "input string not in correct format". But it makes no sense where it is occurring. It is occurring when a string from a textbox ("172") is...
3
by: =?Utf-8?B?QmFycnkgR2lsYmVydA==?= | last post by:
I would like a particular business object to ask for validation when a property is set to a specific value. In this case, I have a TimeStart property and a TimeEnd property. When creating a new...
7
by: php_mysql_beginer911 | last post by:
Hi .. hope someone will help i am trying to figure it out why i cannot post string "union select" every time i try to post data which content union and select .. the page doesn't get posted and...
14
riverdale1567
by: riverdale1567 | last post by:
Hi I am a newbie trying to get some of my first code working, yada yada yada. I have a drop down box which chooses a state then takes the post data to 'processform2.php' to use that to pull up...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.