How To Prevent A Whole Page Refresh

Oct 23, 2007

I built a site in PHP. All the site is working with the same URL, which is My paging is done with forms that sends the submit info to the same index.php script.

The problem is that every time a user is changing the page (via the main menu or other ways), all the page is refreshed (dissapear for a while and appears again with the new page), even though most of the page is unchanged.
Does anybody know what can cause that problem (maybe caching issues?) and how can I solve it?

View 1 Replies


Is There A Way To Prevent A Refresh Of A Page?

Is there a way to prevent a refresh of a page?
When a user refreshen on a certain page, pictures he already uploaded, will
upload again...

View 4 Replies

Prevent Refresh Page While Submitting Form?

when registration form submits using POST method and when you refresh the same page then it will prompt for resubmit or resend information. how we can prevent this??

View 3 Replies

Refresh To Next Page To Prevent Timeout Concerns?

I'm trying to manipulate my mysql tables with PHP but when I update them via PHP I have trouble with time out concerns. Is it possible to refresh or "start a new session" while continuing on from last session? So it doesn't time out? Or is it possible to somehow go to a new page to prevent time outs? Maybe switch over to a new page after 150 successful queries or after 10 seconds?

View 2 Replies

Prevent Rerun Of Script On Page Refresh?

when I add/Delete data to my database (MySQL) using php, i discover that when i refresh the page my Add/delete script runs again and add (or attempt to delete) another copy of the record i added/deleted initially. How can I prevent a block of php script from running twice after clicking refresh button. ( I dont want to have to check the database to see if the record already exist).

View 6 Replies

Prevent Form From Submitting On Page Refresh?

I am trying to learn PHP. I have set up a database, a table, and made a form that allows me to add new rows to the table when the submit button is clicked. The problem is that the form also submits any time the page is loaded or refreshed, which results in a bunch of empty rows in my database table. How do I make it so that my PHP form only submits when the user clicks the submit button or clicks the enter key? [URL]

Here is my HTML form:

<form method="post" action="things-to-do3.php" class="form">
<div class="formfield">Person: <input type="text" name="person" /></div>
<div class="formfield">Task: <input type="text" name="task" /></div>


View 1 Replies

Prevent Script From Re-executing Action On Page Refresh?

I managed to add new items in the cart, and the URL looks like below.


The question is simple: How can I prevent from adding the same item again in the cart if someone refreshes the page? Cause now every time someone refreshes the page, it changes the quantity to +1 for the specific item..

Also, after moving to the checkout page, if they press the back button in the browser, AGAIN the quantity will change to +1;

View 4 Replies

Prevent Variable Update After Page Refresh Without Javascript?

A friend of mine is developing a web application that's more of an online learning facility. On each page is a set of questions. He wants that when the use has answered all the questions on a page and submitted (and taken to the next page for the next set of questions), he shouldn't be able to go back to answer and resubmit those questions again. The idea is that "opportunity comes but once". He doesn't want to use javascript because it can be disabled which leaves him with server-side coding. He uses PHP.

View 2 Replies

Prevent Duplicate Record Insert On Manual Page Refresh?

I have a problem which has only just surfaced itself. I'm working in a MVC environment. The method names in my interface class match those of the request module and action i.e. ?module=test&action=action would result in a method called public function test_action() { }

In this particular problem, I have a form which submits to itself. If validation passes, a record is created and I then show the template of another module. This module expects a series of post variables as it is used in two modules.

The problem I'm having is that, if the user successfully passes the validation and attempts to F5 the page, another new record is created etc. How can I prevent this from happening?

Normally I would header redirect after a successful insert but in this instance I can't.

View 5 Replies

Refresh Problem - Last Command Gets Re-executed - How To Prevent?

Working on the PHP DB I took over I have just come across a problem. When the user presses refresh in some circumstances the command they just performed will be re-performed. In some cases this is very undesirable.

Further example:

There is a PHP page in my web application that has a text box and the ability to add a note to the account the user is currently viewing. When the user presses submit the page reposts to itself with a hidden command parameter so the form knows what to do before redisplaying the account
details (with the new note). However if the user presses refresh, the command gets re-executed again and we now have another identical note added to the account.

Not desirable behaviour particularly when it comes to editing / deleting items etc.

Bearing in mind this is a large application that will have many pages to change and a Monday deadline for new changes, what is an easy way I can prevent this? How do other people cope with this? Maybe from the start the whole thing should have been approached differently but I have to work with what I have.

View 3 Replies

Best Way To Prevent Refresh Rerunning Php Code In Script

I have a fairly simple PHP page, which takes form input for a message, and on pressing the send button, it sends an email out.

The problem I have is that when a user presses refresh, it sends the email out again.

I use a form action to send a hardcoded value of sent=1, which reruns the script in order to send the email out. So when pressing refresh, it still has this value of 1 set, and hence the issue.

Does anyone have any advice on how best to deal with refresh, so its not processing the form again?

View 2 Replies

Prevent Duplicate Record Insertion On Refresh Without Redirecting?

I have this bit of script:

if (isset($_POST['comment_posted'])) {
$user_comment = mysql_real_escape_string($_POST['user_comment']);
$add_user_comment = Event::addUserComment($id,$user->user_id,$user_comment);

After a user submits his comment, and refreshes the page, he is being presented with the "you are going to resend the post data" warning. And if the user accepts, it will re-insert the user comment.I understand that I can prevent that by adding using the header function and redirect the member to the same page. Is it possible to solve this issue without redirecting the member?

View 2 Replies

Prevent The Item Being Added Twice When The User Clicks Refresh?

If I am adding something to a DB using POST and I want to prevent the item being added twice when the user clicks refresh, how can I do this?

View 3 Replies

Refresh, Stop The Previous Function Being Called Again On Page Refresh?

I have a function that imports a files contents into mySQL and returns the results. If i refresh the page and click "yes" it will do it again doubling the output with the same content. How can I stop this happening? In this particular case there is no URI in the address bar but on other functions there is.

View 4 Replies

Prevent Inserting Duplicate Record In Datbase When Refresh Form?

Here is video and there is shown how specific this problem is[URL]...Solutions Witch doesn't fit in for this time is meta refresh,header(),exit(),die() .

View 4 Replies

Refresh Page - Or An Absolute Refresh Not Reload.

If the image content for image1.jpg changes, but the file name image1.jpg
does not, IE6 does not show the new content unless F5 is pressed.

If I reload the page using the image
does not change.

If I use a header("LOCATION:"), the
image does not change.

I have tried several ideas to force the reloading of the image file with no
little success.

I cannot change the image file name.

Even if I add another a second image, the first image does not change.

IE must use the file name to determine if it should reload the file. But F5

Is there a means in either php or JavaScript to call (force) a F5-keyboard
command? or an absolute refresh not reload.

View 1 Replies

Refresh A Page Without The Header Refresh?

how do I refresh a PHP page without the header refresh?

View 5 Replies

Prevent Memcache Storing An Incomplete Page When Someone Clicks Away Prior To Page Load Completion?

I'm fairly new to memcache so apologies if this is an obvious one. I have looked through the memcached documentation and tried various Google searches but to no avail. The setup :

Drupal 6.19
Memcache API and integration module
Authcache module
Centos 5
Memcached 1.2.6

If you need further information let me know. The situation: Memcache is certainly running, bins are being filled and page load times are incredible. However, I noticed only recently, when doing some testing that when I clicked on a link before the page had finished loading memcache stores the current page state in memory. So, when the next user comes along he sees a half formed page that I was too impatient to wait for.

Your response might be to sort out my page loading - which I'm looking in to. But I would like to solve this one as well. This means that if a user with a particularly slow connection is the first one to visit a page then he / she might click away and store an incomplete page for everyone else to see.

View 2 Replies

Refresh Problem - Warning: Page Has Expired The Page You Requested Was Created Using Information

i got two php page at the movement, which they called edit2.php and edit3.php. when i submit a form from edit2.php to edit3.php, then i could not come back from edit3.php to edit2.php.

Warning: Page has Expired The page you requested was created using information
you submitted in a form. This page is no longer available. As a security precaution,
Internet Explorer does not automatically resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh button. Code:

View 1 Replies

Page Refresh Without Relaoding A Page And Calling External Files In Ajax?

I have a profile page where im showing the friends of that user from db, I'm using auto scroller that works fine if I place that data directly in main file not an external file, Also I have a drop dowwn that on selection will sort the friends records accordingly, but as i have moved the code to main file, i need to make ajax call to same file not an external, to repopulate data with required sorting.Please let me know how can i do this on same file with ajax. On selection of drop down value.

View 2 Replies

Cookies - Using A Audio In Web Page I Need To Play It First Time But Not On Page Refresh ?

I'm using a audio in my web page i need to play it first time but not on page refresh in php

View 2 Replies

Prevent Included Htm Page From Being Loaded Outside Of Parent Page?

I have a page thisfile.htm, which is included in thisfile.php

I used to load thisfile.htm into an iframe on thisfile.php but because of iPad scrolling trouble, I recently converted everything to scrolling divs and php includes.

I need to prevent the htm file from being loaded independently of the php parent. When I used iframes, I had no problem doing this with some javascript. But I can't get it to work with my php include - I get a loop.

This is in child:

<script type="text/javascript">
if(top.location.href==self.location.href) {

This is in parent:

<div class="bigdiv"><?php include "thisfile.htm" ?></div>

View 2 Replies

Redirect A Page And Load/refresh A Div Within That Page Using Ajax?

I am using ajax to redirect to a page by window.location = "page.php"After the page is redirected I need to load a div within that page. For example search.php. I have been reading up on how to do this and from what I gather you can do this by using jquery. I have never used jquery .If it can be done without jquery even better!

Edit: Let me explain again what I am trying to do. I have a table that updates that the db. All of it is done through php, js and ajax.

For example "Displaytable.php" displays the table. The user can search and it replaces the search result in a div. When someone wants to update it goes to update.php. After it's updated i want to redirect the page to Displaytable.php with the search results in the div. I am using session variables to do the search. The search works fine i have tested it in another page.

View 2 Replies

Automatic Page Refresh Without Reload Of Entire Page?

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 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

Page Caching - Content Does Not Change When Refresh Page

I am trying to experiment with page caching. I would like my page to be cached by the browser for 15 mins. Because the page content does not change much but it downloads thousands of the same records from the database every time the page loads. I am generating the following header:

<meta http-equiv="Expires" content="Mon, 21 Sep 09 14:26:47 +0000" />
<meta http-equiv="Cache-control" content="private" />

with the following php code:

gmdate(DATE_RFC822, (mktime() + 900));

I am also printing out the the current time on the page to check if the page is really being cached or not.

echo date("H:i:s");

It is my understanding that the time would not update on the web page if the page is really being cached.
Unfortunately it's not

View 5 Replies

Launch New Page And Refresh Exisiting Page

I know about not being able to change header info after output to the browser but what are the workarounds if any?

I have a basic form where a user logs in - the details they submit are verified in supportlogin.php and then if successful I launch another browser window with Javascript but the window in that they logged in at remains on supportlogin.php and is blank... How can I launch the new window and send the first window back to the login page? PHP Code:

View 2 Replies

Copyrights 2005-15, All rights reserved