Re: How to avoid the text box value to be printed when I click on IE Browser refresh button?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Another way is to use a variable in session. Session will be maintained at 
server. so php will take care of it.

<?php
session_start();
//put no-cache headers.

if($_POST)
{
     if($_SESSION['alreadyPosted']!=true)
     {
          //post operations with the form textbox value.
          $_SESSION['alreadyPosted']=true;
     }
      //first time sess var will be false, so script executes
     //from next time, sess var is true, so script will not execute.
}

//form html
echo '<form .. >';

if(!$_SESSION['alreadyPosted']) echo $_POST['textboxValue'];

echo '<input .. textbox><submit button> etc';
echo '</form>';
?>

Bye,
Manda Krishna Srikanth
http://www.krishnasrikanth.com

php-objects@xxxxxxxxxxxxxxx wrote on 11/27/2007 12:31:53 AM:

> Hi,
> If i understood correctly there is no short answer to this, as 
> refreshing the page is exactly same as sending the parameters again 
> by clicking on submit.
> One thing you can do is sending the parameters by POST method , this
> way the user will be promted to confirm they want to refresh,
> If this is not the sol, than you can while printing also send an 
> extra hidden variable like refresh at the first time on submit 
> button operation. 
> <input type="hidden" name="refresh" value="1">
> If this is set during the refresh operation show some error message.
> Hope this helps if not pl. ask again.
> Thanks
> --
> Regards,
> Abhishek jain
> 
> ----- Original Message ----
> From: Anand Vijaya Kumar <anandvijayakumar@xxxxxxxxx>
> To: php-objects@xxxxxxxxxxxxxxx
> Sent: Monday, November 26, 2007 5:12:00 PM
> Subject:  How to avoid the text box value to be printed
> when I click on IE Browser refresh button?
> 
> I would appreciate if someone could throw some light on this issue.
> 
> I have a form with a text box and a submit button. When I click on 
> the submit button, I am able to echo the text box value in PHP. The 
> problem is I am also able to echo the original text box value even 
> when I click on the IE Browser refresh button.
> 
> The question is how to avoid the text box value to be printed when I
> click on IE Browser refresh button.
> 
> Note: I am echoing the text box value on the same form.
> 
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you




[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux