473,327 Members | 2,103 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,327 software developers and data experts.

page refreshproblem

1
Hi All,
I am having form, where I need to make all the _POST data as null when the page is reloading..

Thanks in Advance..
Cheers,
Lincy.
Dec 19 '08 #1
3 1144
Markus
6,050 Expert 4TB
lincyk,

Please do not Hi-Jack other people's threads. If you have a question, please start your own thread with that question. I have separated your posts from a different thread into a new one.

Thanks,
Moderator.
Dec 19 '08 #2
nathj
938 Expert 512MB
If you know the names of the elements in the array you can use them and access the element overwriting it with an empty string
Expand|Select|Wrap|Line Numbers
  1. $_POST['item1'] = "" ;
  2.  
Alternatively you could do it with some sort of loop to access the elements in turn blanking each as you go. this would then work even if you added to the form or removed items from the form.

Cheers
nathj
Dec 19 '08 #3
dumm
10
A way to do this, is to set a session once the form has been process.

Example:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. session_start();
  4.  
  5. if(!empty($_POST) && !$_SESSION["FORMSUBMITTED"]){ // process the form data only if the session return false
  6.  
  7. // process your form here
  8.  
  9. $_SESSION["FORMSUBMITTED"] = true; // set the session to true that the form don't get process again on refresh
  10.  
  11. }
  12. else if(!empty($_POST) && $_SESSION["FORMSUBMITTED"]){ // if form data his not empty and the session is set ( double post refresh )
  13.  
  14. $_POST = array(); // empty the form data
  15.  
  16. }
  17. else if(empty($_POST)){ // if form data is empty reset the session to false
  18.  
  19. $_SESSION["FORMSUBMITTED"] = false;
  20.  
  21. }
  22.  
  23.  
  24.  
  25. ?>
  26.  

Hope it could help!
Dec 19 '08 #4

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

Similar topics

1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
0
by: Nathan | last post by:
Hi, I seem to having a peculiar problem with the display of odd and even pages in XSL-FO. Here is a small background of the problem. My xsl stylesheet mentions my fo:layout-master-set as ...
2
by: James | last post by:
I've been to websites where if I navigate off a form, trying to get back to it by hitting the back button gives me a page which says "Warning, page has expired". It doesn't display the page. I've...
4
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
6
by: MooreSmnith | last post by:
When I navigate to the next page using Response.Rediect("MyNextPage.aspx") current page Page_Load event is called. What I may wrongly understood is that post back will happen whenever there is any...
1
by: Lenard Gunda | last post by:
Hi! I have the following problem. From my main page, when someone clicks a button, it uses client side javascript to open another .aspx page. This page displays content, based on what the...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
7
by: UJ | last post by:
I've got a page with a user control on it. While the page is loading, it needs to check certain conditions of the user object to enable/disable things on the screen. Currently in the page_load of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.