Avoid Page Reload Resend - Data Message With It?

Aug 17, 2009

I wrote a simple Contact Us email form (actually a WordPress page-template file). All the code is in one file. After the user submits the form and the email is sent, the file generates a Thank You message. If the user reloads the Thank You page, they are prompted to "Resend the Form Data," which is why I am asking this question.

My question: How do I avoid the prompt to resend the form data and still keep all of my code (including the Thank You data) in one file? EDIT: I've seen folks use headers( Location: ), but I don't think that will work for if I want to keep all my code in one file.


Avoid The Message 'warning Page Is Expired, Press Refresh Button To Reload?

Jun 8, 2010

how to avoid the message 'warning page is expired, press refresh button to reload' when we press back button in php.

View 1 Replies View Related

Caching - Clear Browser Cache To Avoid Form Data Resend After Refresh

Nov 16, 2010

I'm developing a PHP-MySQL app that enables registered users to enter text comments. Problem is:

User sign-in into the web site - OKAY
User presented with a form to submit text comment - OKAY
User enters text comment and submits - OKAY

I have a routine that sanitize the comment & save it into MySQL (with userid, textcomment, datetime stamp) & present back the user that his/her comment is entered - OKAY

User decides to refresh browser - a duplicate comment is entered - BAD!

I was thinking 3 options: OPTION 1: Routine that checks: last time user posted comment, and if so, check if this is a duplicate. If duplicate then display error message. OPTION 2: Routine that does not allow a user to post too quickly. So basically do not allow postings of comments within 1 minute or so. So if browser is refreshed the comment will be ignored. OPTION 3: Manipulate the browser cache to clear out its contents so when refreshed no duplicate will be entered.

Now in the context of my application, my concerns with OPTION 1 and OPTION 2 is performance PHP-MySQL since I already have various queries within the same page that push/get data from databases. So OPTION 3 may target the issue differently. Questions is: If I go for OPTION 3 can this be considered a Best Practice?

View 5 Replies View Related

Form Validation :: Reload The Page With Red Error Message

Apr 3, 2007

I wrote the following form so that if a user leaves a field blank the page will not process and instead be re-loaded with a red error message asking the user to enter the missing information: Code:

View 1 Replies View Related

$_SESSION['message'] : When I Hit Refresh And Reload The Page The Number Doesn't Increment?

Aug 23, 2010

It's working to my favor but I don't trust it unless I know why it's working.Real world example:

I reference $_SESSION['message'] twice in my code.First looks like this:[code]...

Second looks like this:echo $_SESSION['message'];

For some reason, this is working for me and $_SESSION['message'] is getting unset after it's echo'd (but the user remains logged in so I know the entire session is not getting unset).

Test example: I put the following code in test.php:
echo $_SESSION['message'];

When I hit refresh, reload the page, etc. the number doesn't increment, it's stays as '1'. If I change it to $_SESSION['success_message'] the number does increment.So? Is $_SESSION['message'] reserved? Does it automatically reset once it's echo'd? I didn't find anything in the manual on this.

UPDATE:I just checked in Firefox and test.php works as expected. In Chrome it doesn't. Chrome does so many wacky things, I wouldn't be surprised if it's resetting $_SESSION['message'].

View 9 Replies View Related

Can Header() Do A Div Reload Without A Page Reload (ie Ajax-type)?

Oct 17, 2006

I have a display page (displaypage.php) divided into two panes - one for content and one for feedback, referred to in the CSS as contentDiv and feedbackDiv respectively.

When I click on a word in the content pane, I do a PHP/PostgreSQL search for similar words, and the results appear in the feedback pane without a page reload. For this, I am using a very basic Ajax setup Code:

View 2 Replies View Related

Resend Values To Other Page Using It

Sep 21, 2010

I have some problem posting data to other page. Now i am explain. One page (called A.php) is refershing and checking database whether status 1 or 0. If sataus finds 1, A.php page posting values to B.php automatically. Then i need to confim whether B.php page getting values or not from A.php. Suppose If B.php page did not get the values from A.php, I need to resend once again to B.php page.

So the problem is , once i sent the values first time from A.php to B.php, as we know suddenly A.php page has gone and display B.php. I can not resend once again from A.php. How we can send Once again from A.php to B.php?

View 4 Replies View Related

Resend Hidden Variables Again On Same Page?

Sep 7, 2009

i am login in php file then on 2 php file i am checking values which i sending user name from 1st php file to 2nd . main problem is i am refreshing 2nd php file after each 4 min, but it not resending values, so how i said on 2nd page i am checking with database. if it not match with values then reload same page as invalid user name and password.

View 1 Replies View Related

Not Give Error When Resend After Sending Something + Refreshing The Page

Sep 26, 2010

making it not say resend after sending something + refreshing the page

View 3 Replies View Related

Avoid The Getimage() Warning Message?

Jun 6, 2009

Recently i worked in project. there i need to a resize a picture and i use the following class.

class SimpleImage
var $image;

View 2 Replies View Related

Check If Dir Exists Avoid Error Message?

May 17, 2011

I think I have missed something with the code below... Maybe you can help

$imageurl = $pagename1;
$imageurl = preg_replace('/.asp/', ''.$g_sites_img2.'.jpg', $pagename1);
$filename = $_SERVER{'DOCUMENT_ROOT'}.'/images'.$imageurl;
if (file_exists($filename)) {
echo '<img src="'.$mainurl.'/images'.$imageurl.'" width="'.$g_sites_img2.'" align="left" />';
} else {
$imgremoteurl = $imgremoteurl.str_replace(' ', '_', strtolower($g_page_identify));
$imageurlfolder = dirname($pagename1);............

If I refresh the page, the error message disappears when the file is created. How can I write the script so that it checks the folder, if it exists it does not throw the error?

View 2 Replies View Related

Error Handling - Avoid Warning Message?

May 27, 2009

Recently i worked in project. there i need to a rename a picture. the problem is when i rename the picture it renamed but show a warning message like bellowWarning: rename(seeker/SeekerPhoto/katr.jpg,seeker/SeekerPhoto/ussl.jpg) [function.rename]: No such file or directory in /subdomains/www/html/ussl/job/insphoto.php on line 100 how can i avoid this warning message. that mean whatever the warning was it will go for next task.

View 5 Replies View Related

Avoid Dead Message In Comet Chat?

Jul 14, 2009

I am doing Comet chat with Erlang and PHP. But now I think I met a problem: the polling connection will disconnect and reconnect automatically in about a certain time (I set this with 10 seconds), so there will be a period of time that the user doesn't connect to chat server. If a user send message at that time, the message will be dead (no one could receive it). In the client code I am using jquery with jsonp to realize the polling connection.

View 3 Replies View Related

Error Message - Avoid Notice In When One Of The Conditions Is Not True?

May 25, 2010

I've notice that when one of the two conditions in a php if statement is not true. You get an undefined index notice for the statement that is not true. And the result in my case is a distorted web page.
For example, this code:

if (!isset($_SESSION['loginAdmin']) && ($_SESSION['loginAdmin'] != '')) {


View 8 Replies View Related

How To Refresh Page Without Prompt The "resend Information...."?

Jul 17, 2006

I wrote a PHP page for user input the information to search the
database. And the database data will update every second. I want to
set the auto refresh to get the data from database every minute. But
the page always display the dialog box ask me to resend the
information. How to disable this warning message. I using POST and
REQUEST to get the data from user input page.

View 10 Replies View Related

Session Var Is Setting ONLY AFTER I Reload Page, Form Var Displays First Page Load

Jul 17, 2005

Page1 has a form that calls Page2. The beginning of Page2:
<? php session_start();
session_register("s"); ?>

in the middle of Page2 I have a form varaible:
<?php echo $_POST['stateSelected']; ?>
<?php echo $_SESSION['s']; ?>

The form var displays the first time the page loads. The session var
displays only after reloading the page2.

View 3 Replies View Related

Automatic Page Refresh Without Reload Of Entire Page?

May 15, 2011

refreshing a top bar just like facebook where the no of messages are getting updated when the new messages comes just like facebook or gmail without refreshing the whole page . i can do this if that top bar is located externally i can refresh that bar with either meta tag set timeout or with refresh tag , but not getting how to refresh when it is part of main page.how to do this without reloading whole page and without any external file as the full code of the inbox and alert is located in main.php so i cant take it out and call these function externally.

View 5 Replies View Related

Page Reload

Jul 17, 2005

I have succesfully created a login page for my site. I have used the PHP_SELF
so that once the user has succesfully logged on the page reloads. Everything
works fine the first time somebody tries to log in but when they revisit, the
log on page is bypassed and it goes straight to the information page. I have a
sneaky suspicion that this is due to the fact that the page is then in their
history of recently visited sites. How can I use PHP to refresh the page
automatically everytime it is requested?

View 8 Replies View Related

Reload Page On Die

Feb 4, 2006

I have a query that seems to fail about one out of five times, resulting in a completely blank page. Here's the query and the call to it (which appears before any HTML is displayed): PHP Code:

$query = "SELECT msg.id, msg.to, msg.from, msg.subject, msg.date,
  u1.first_name as to_first, u1.last_name as to_last,
  u2.first_name as from_first, u2.last_name as from_last
FROM messages msg, userprofiles u1, userprofiles u2
WHERE msg.read = 'n' AND u1.id = msg.to
  AND u2.id = msg.from AND msg.to = '$userid'
ORDER BY msg.date DESC";
$reslt_message = mysql_query($query, $conn) or die(mysql_error());

If there is anything wrong with this query, please let me know. Otherwise, assuming that the query is ok, would it be wrong (or even work at all) to put a header inside the "die" that reloads the page, or would that be bad practice? I can see the possibility of getting an infinite loop, but that could be remedied by adding a variable to the end of the header that would force the code to reload only if it hasn't reloaded yet. if that is clear. When the page crashes, refreshing it works. If I click the link to this page 10 times, it could be the 1st or 10th time that results in a crash, so I'm thinking that the query is ok but it is having trouble processing it or something, which is what led me to think about reloading the page.

View 1 Replies View Related

Reload Php Page

Dec 20, 2005

I am creating (using php) an html page with many links. Clicking on a link open the link as _self. Clicking on the browser back button brings the prv html page (with the links,) but instead of getting it from the cache it will recreate it. how to avoid the re-creation of the php/html page and just to reload it from the cache.

View 3 Replies View Related

Reload Page

Sep 22, 2005

I have a form which is used to add / edit records in a mysql db. This all works fine but after entering a record, and returning to a database view page, a user can hit reload page and a new record is added. Clearly, the previous $_POST vars are still in the system and thus reloading the page runs the same script to add a new record.

View 1 Replies View Related

Reload This Page

Feb 27, 2006

I'm trying to create a cookie on the user's machine that includes the referral url. I then plan to call the data from the cookie in a script that is called on my thank you page to track sales. Why won't the following script work? It's writing "$_SERVER["HTTP_REFERER"]" to the cookie instead of the referrer URL.

<?php $value = '.$_SERVER["HTTP_REFERER"].' setcookie("solvotrack", $value, time()+2592000); /* expire in 30 days */ ?>

View 3 Replies View Related

Form Reload : If User Click The Reload Or Refresh In IE, There Is A Warning Window Popup?

Oct 29, 2009

I am writing a very simple code which involve HTML, PHP and Mysql, here is what I have done and the Help I need: the 1st file: index.php

PHP Code:


the DB/table related: I have a DB named mydb in MySQL, which have on table, comments:

`user` varchar(30) NOT NULL,[code]...

load index.php after you creat the table using above sql..and jump between index.php?id=aa and index.php?id=bb, and u can submit the form and see the comments imm showing after ur submit...it looks great, BUT My problem: if user click the reload or refresh in IE, there is a warning window popup, and remind user not re-submit, but if some user really resubmit, my table will have duplicate record...no change on my entire scripts stucture, means I must use above ?id=$_GET(id) tech to jumping between the aa file and bb file, and I must include both form and insert process in same file, the user expriense should not been impact........

what I need is while user click the reload, no pop window, no duplicate record been insert

View 14 Replies View Related

Page Cache/reload

Aug 1, 2003

I have created a facility for users of a site to enter details of property (e.g. location, size etc.). This allows them to upload a picture. Users can also update a picture, adding a new picture to replace an existing one.

My problem is that if a user changes/updates the picture and then views the details the old details are displayed unless the user manually clicks refresh.

I know that this is because IE is storing the page in cache. I have tried the Meta Tags with "no cache" and "expires" but they don't work. I have also tried to get the page to refresh itself on loading, but it either doesn't work at all or keeps refreshing over and over again. Ideally i would like the page to just refresh once and then stop refreshing but there doesn't appear to be any way of doing this.

View 6 Replies View Related

Does 'Back' Reload The Page?

May 14, 2007

I notice that when I click the 'Back' button my previous script runs, i.e, all the php code runs (I previously thought that maybe the previous form displays without the code re-running).
However, I do not get the expected value displayed on my form.

After populating one element in formA with &#3917;' (just any number) and submitting to formB (using POST ---> Redirect --> GET to avoid the 'expired from cache' message) I then click the 'Back' button and the 17 does not appear. In the code below, after clickng 'Back', I see as output from the echo statement that rb_value[0] is, infact, &#3917;' but within the form, the text element named rb_value[0] displays as empty.

Does anyone have suggestions why this might be?

It might have to do with that I do not understand what the 'back' button does. Or maybe with my PRG (post - redirect - get) model.

Here is part of the code:
echo "rb_value[0]=".$rb_value[0]; //After clicking 'Back' I see that rb_value[0] is 17

if (isset($rb_value[0])) {
$rb_val = $rb_value[0];
} else {
$rb_val = 1;

$line.= "<td width="20%" valign="center" align="left"> ";

// This element displays as empty instead of the expected 17
$line.= "<input type=text name="rb_value[0]" value="$rb_val" size="25" maxlength=25 </center> "
$line.= "</td> ";

View 5 Replies View Related

Increment ID In A Page On Reload

Aug 29, 2007

I have a page that has an iframe on it, PHP Code:

<iframe src="index.php?u=<?=$ID?>" width="400"></iframe>

What I need to do is on every page reload increment the $ID variable so I load the page

1 time then
$ID = 1

new page reload

$ID = 2

how can I do this?

View 3 Replies View Related

Reload Same Page With New Query

Oct 28, 2007

how would I go about reloading the page with a new query by a click of a link.

right now its loading everything from my table,

SELECT * FROM usr_img;

I want to be able to click a link and have the page reload with,

SELECT * FROM usr_img WHERE img_cat LIKE 'Birds'

Can anyone help me, im still learning php.

View 11 Replies View Related

Resubmitted With Page Reload

Sep 13, 2007

I am using PHP5 and IE 6. I have made a web form. The action attribute of the form is redirecting it to the same page. Like action="index.php" and form name is also index.php . I am using Post method. When the user clicks on the submit button all the post variables are check by the isset function and then only the function to insert data is executed. If the user clicks on submit first time the data is submitted.

View 1 Replies View Related

Reload The Page After <fb:like> Is Clicked?

Feb 12, 2011

I'm wondering about this: I have a simple facebook-connect app that will only show certain content after you login and liked a certain page. It works (huzzah!) but I want to make it more user friendly by making it refresh automatically after you pressed the like button.

Here's some code:

if ($me) {
$pageid = -----------;
$uid = $me['id'];
$likeID = $facebook->api(
array( 'method' => 'fql.query', 'query' =>
'SELECT target_id FROM connection WHERE source_id = ' . $uid . ' AND target_id = ' . $pageid )

View 4 Replies View Related

Refresh To Reload The Page

Jul 29, 2007

i was using header("Location: http://test.com/alt.php"); on my php page as a refresh to reload the page as i need to refresh the whole page but hold my sessions i set to rest the forms on it.

but then i had to create a header redirection page in  the website to have get the websites template page on the page i created for the  menu logo  etc. so turning the original page into a redirection to achieve this.  So now my php page is in zen cart and is called in on the first the redirection nut when i try and use a second header location it doesnt work.

View 2 Replies View Related

Page Reload With An <iframe>

Mar 13, 2007

Let me to explain the structure....

filename : api.php

Having an <iframe src="remotehost/index.php"> </iframe>

i have to reload current page api.php after some execution of remotehost/index.php ... I've tried header(); but got formal header error. can we reload current browser url from an iframed code?

View 3 Replies View Related

Page Reload On New Post By Someone Else?

Jan 19, 2010

I basically have this game going with my friend (a quick website i made) called word association.

basic idea: Potato > Chips > Crisps > Snack > Biscuit etc...

If anyone is familiar with facebook's live feed thats exactly what I want for it to just pop up the new posts as there is only 2 people playing this game I dont think it should be too hard to code :)

View 1 Replies View Related

Reload A Page Without Using Headers?

Mar 20, 2010

Is it possible to reload a page without using header("location:/");As that generates an headers already sent error. (When using the script after any html)

View 7 Replies View Related

Page To Reload The Same Page After Being Logged In?

Jul 11, 2010

$logonSuccess = true;

Is there alternatives to this? Also, if i want the page to reload the same page after being logged in what would i change in the code to do that?

View 1 Replies View Related

Reload The Same Page With A Form After Submit?

Nov 18, 2001

I have a page with a form, and the code to process the form answers, I want the same page/form to just reload when the user presses submit. The only function I have found is that location command. PHP Code:

View 10 Replies View Related

How Do I Force A FRESH RELOAD Of A Page

Jul 19, 2003

I've built a few php scripts, but since its reloading the same page I can't get it to refresh the page. I've implemented some expire meta tag...but is there anyway I can try and force it to refresh?

View 3 Replies View Related

Reload (refresh) Page Within An If Statement

Nov 28, 2006

Is there a simple way in php to reload a page coded within an if statement.(see code below)It's very important that the session stays intact. Code:

View 8 Replies View Related

Refresh Div Content Without Reload Page?

Jun 9, 2011

I'm having some trubles when update the div content without reload the page.I'm using jquery, php and mysql as well.Well I've tryed:

$('#divId').load("script.php", function(){

But it's not working at all.

View 1 Replies View Related

Keep Values After Page Reload Of JavaScript?

May 9, 2011

I have a PHP file with a form. This PHP file uses a JavaScript for a drop down pre-selection. If a user selects a value in drop-down1 then there is a limited selection in drop-down2. This JavaScript definitely needs to reload the PHP file for changing the values of the second drop-down2 list. How can I keep the entered values of the user in the form, after the JavaScript has been executed. Currently all entered data get lost.

One option would be to set all values into the URL and grab them with GET. Yes.. that would be an option but as I am using 13 values, the URL would look not too nice. I don't want to user to take notice of what happens.

I cant use the POST, as I don't push the posting button.. it's just the JavaScript that gets executed and reloads the page. I thought about filling the Session with the entered data but that is not directly possible as JavaScript is on the client side and the session is on the server side.

Form Example:

First Name (text box) Last Name (text box) Age (drop-down) Sex (drop-down)
Province (JS drop down) District (JS drop down) Commune (JS drop down) Village (JS drop down)
Transf.from (drop down) Health Center (text box) Ambulance (drop-down) Self.transferred (drop down) SEND BUTTON..............

View 2 Replies View Related

Page Reload On Form Submit?

Jul 4, 2011

I've been stuck on this problem all day. Help would be greatly appreciated:I have an 'edit' page.I have declared my variables up top to make "sticky" radio buttons when somebody goes to edit the form.I have it submitting successfully, however if I go back to "confirm.php" with the form action, the content that was just submitted doe not display on the page.If I use PHP_SELF, the content in to form reverts back to what it was before it was editied, however the table was updated.

<form method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
<!-- ---------------------- -->

View 1 Replies View Related

Reload Page Without Submit Form

Oct 18, 2010

i have two radio buttons: 'Accept' and 'Don't Accept' when the form submit button is pressed and the 'Accept' radio is not checked i want the page to reload without sending the info accross.


none of the above work as it keeps on sending the form and going to next page.

View 4 Replies View Related

Reload Page Without Form Data

May 29, 2010

As the title says im posting some form data to another php file that processes it. I then want to return to the orig. form to start over but the same data is still in the form. Whats the best way to go about making the form fresh.

View 7 Replies View Related

Click The Customers Name And Reload The Same Page?

Aug 13, 2009

First off im new here and im a novice at PHP.I have been beatin my head off the wall trying to figure out why this wont work.

Code:<?php session_start();
if (isset($_COOKIE['cookuser']) && isset($_COOKIE['cookpass'])){


Basically the problem is when i open the page, the list of customers lists out.If i click the customers name i want it to reload the same page but with the values of what was selected.it gives me "FATAL ERROR:Call to undefined function details() on line 14".BUT if i put details(); under custlist(); at the bottom with the?id=1 after the URL everything works.I have used links to so many funtions befroe and this is the first time this has happened.

View 2 Replies View Related

Reload - Page Keeps Loading Forever

Jan 12, 2011

I am working on a php page, and for some reason, it keeps loading forever, even when it looks fully loaded.
Here is a link: Php Page

This is the source code:

define('IN_PHPBB', true);
$phpbb_root_path = '../../../foro/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);


View 2 Replies View Related

Reload The Page Immediately After Display ?

Jan 15, 2011

Right now after posting that text is displayed, I want to reload the page also.This is thtext that is displayed after posting:echo "Tu chisme se publicó con éxito";

View 2 Replies View Related