Is There A PHP Function To Force A Browser Refresh
I have an html page that gets updated about once a week. I would like to FORCE the browser (IE, Firefox, Netscape, or Opera) to REFRESH when the user opens the page to ensure they receive the latest update. Been searching around for some php code to add to the page to accomplish this without success. Can anyone give me a steer to how to accomplish this.
I'm trying to use the code below to make the <a href='http://www...com/.../footervote.php'>Vote</a> link appear if a user logs in and a user shows up in the function getEditorsList(). The vote link only appears if the browser is refreshed.
how I could make the vote link appear without having to refresh the browser?
I basically need to have a certain page reprocess the php when it's accessed by either the forward or back buttons. The current (default) behaviour has it just reload the page from the cache, as normal. This will not work for our purposes it must reload completely. We need the php & database access on every load of this page, and that's currently not happening.
I'm working with a form, and when the user makes a selection the selection only affects the parts of the form past where they made the selection. I need to do a refresh so that the entire page will be affected, how can I force a refresh when they make a change.
I'm trying to force the browser to cache different resources like CSS, images, js and so on forever. It is important for the browser to never try to refresh the images/css since on a page there might be thousands of small images, and when the browser tries to refresh it bombards the server, and needlessly keeps the page in refresh mode. The images/css's never change nless the request path changes. Right now I have the path to the images/css set to a script with a url like: [URL] and the script is sending these headers before sending the resource:
header("Cache-Control: public"); header("Expires: Tue, 19 Jan 2037 00:00:00 GMT"); header("Last-Modified: Sat, 01 Jan 2000 00:00:00 GMT");
However Chrome and Firefox both re-request the image/css if the Refresh button is hit. Chrome also seems to send the request if you hit Enter on the address bar, unlike Firefox. My question is why do they do this since the Expires header should make it not do the request again until 2037, even if the users presses Refresh. Am I doing something wrong, or missing something?
<!-- The following sample should authorize the user to log on the site. This works once but after refreshing the browser, it does not prompt again for login until all browser (IE 6) windows are closed and the same page is opened. I turned off all caching but still it does cache (as a refresh doen not promt again).
How can I force the page to prompt for a password at every refresh
I'm using a bunch of graphs all over my site to display various statistics. Some pages have lots, some have one. The big issue is that if I display the graphs for a particular page multiple times in a row (changing the parameters each time) the graphs don't refresh. Instead the same graphs are shown each time!
Is this because of caching or some php setting or some apache setting (using apache2 btw)? Is there any way to get around this or to force the graphs to refresh?
Emails to customers.It has a send all button at the bottom of the page to provide the convenience of being able to send all the emails at once.Problem is it works badly or not at all.It either isn't redrawing the page or isn't managing to process all the Ajax calls.
function ajaxemail(element,name,email,bonus) if (window.XMLHttpRequest) code for IE7+, Firefox, Chrome, Opera, Safari }
The failure isn't in the page being called by function Ajax email()because that works fine when called once or one at a time.It's when called by the loop that it doesn't work.It seems to do the last one or two items in the loop, or it might do some in between if I do something that forces the browser to redraw(such as size it).If I add an alert as a way of testing that execution of the loop is at least working it successfully runs the Ajax call on every iteration.It doesn't matter if the page becomes less responsive(but would rather it didn't become totally unresponsive)I am testing in the latest Firefox(will test in other browsers once I have it working in FF).
I'm wondering if there is any way to use PHP to force a PDF not to load into a browser window. Currently we have a link to a PDF on a clients website and they want it to be downloaded via the 'Save Target As' menu. They do not want it loading into a browser.
Ok here is what I am wanting to do: Host an image on Photobucket, Use PHP to generate the image with a url as if it is being hosted on my site and cache the php generated image for faster loading later.
I am currently using a photobucket account to host my images so the original file I want to cache is actually at the following [URL].../albums/k126/WrestleMation/Brain_Rush_S01E01_DotNXT_DSR_XviD-E.gif[/code]
I am wanting to display the image with a URL from my site so that it doesn't show the fact that it is on a photobucket account.[URL]../fa_Brain_Rush_S01E01_DotNXT_DSR_XviD-E.gif[/code] As you can tell the image from the second link is being generated to pretty much pull in information from the first one and the displaying of the first one under the new URL works just fine.
To do what I've done, I used .htaccess rewriting to make the php image generation to use a standard image format url.
The php I used to generate the php image is... [code=text]//Get dynamic filename from rewritten url. --- which would be : Brain_Rush_S01E01_DotNXT_DSR_XviD-E $gif_file = "http://i87.photobucket.com/albums/k126/WrestleMation/".$_GET['file'].".gif"; //Load the image header("Content-Type: image/gif"); echo readfile($gif_file); die();[/code]
Ok so the image is generated just fine with my code but the problem is that it has to reload and redownload the image every time the browser is refreshed. Is there anyway I could force all browsers to cache the php generated image so when the generated url is called the next time it pulls from cache instead of pulling from the photobucket account?
I've got a script that generates a csv file on the web root, and currently if I try to redirect to it, it just opens the file in the browser. I'm wondering, is there a way to force the browser to prompt for download of the file insted?
This is probably more of an HTML question than PHP. Perhaps someone here can answer or point me to a proper newsgroup.
How can I force the browser to reload an image from the server?
I have a page where the user can set some parameters and click a <submit> button. A PHP script then generates a .png graphic and saves it to disc. An html statement (<p><img src="gMyGraphic.png"></p>) then sends the graphic out to the browser. Code:
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.
Visitor lands on 1.php and then goes to 2.php. I want browser to re-request 1.php after vistor's click on "back" link. Currently, it doesn't work. How it can be managed? upd. I can edit 1.php ONLY and cant edit 2.php.
I want to basically change my image and data that is being pulled out of a database everytime the browser is refreshed. Heres the scenario i have 2 tables, rentals and sales that contain some of the same fields such as property name description and cost (theres an image too ).
I need a way to change what is displayed every browser refresh, so one time the data might come from one table the next the other table. I was thinking along the lines of setting up a holding table that stores the info from the two table , but i dont know how to tell it to change the data.
I've searched for solutions on how prevent a browser refresh from posting a repeat process, and a suggestion of redirecting the page to a "dummy" page which then flips back to the main page seems like something I can handle. My problem is, I'm not quite clear on the journey. Here's what I understand:
Page loads, waits for user input. User fills out form and hits "submit". Page inits, with $_POST variable populated with form data (I have a db_start() up top). HP code is processed, at which point I take care of form data.
here is where I'm not sure how the redirect should happen. I'm thinking efore page is released to browser, I redirect the page to the "dummy" page with something like this:
I have a free-ads type website and when a new ad is uploaded it needs to be sent for manual authorisation. What i would like to do is have a pop-up window that will refresh itself or something similar when a new ad has been uploaded so it flashes orange in the start bar much like msn messenger would do.
I have a script which allows a visitor to the web site to upload an image. Since this replaces an earlier image, it gets given the same name (desirably). The upload, and the renaming happen OK. But when all is committed to the database and the visitor is shown the result, the old image is still visible. Clearing the browser cache and refreshing the screen (manually) shows the new image.
Is there a way I can get PHP (or JS, I suppose) to do this automatically as part of the script ?
I have a page with 2 dynamic headers. The first header shows a link to a sign-in page if the user isn't signed in. The second header shows the users name and a link to a sign out page if they are signed in.
This all works well but I have spotted a usability problem. If the user clicks the link to the sign-in page then signs in and selects BACK the old sign-in header still shows. It looks as if they still need to sign-in, until they move off to another page then the correct header is shown.
This is probably a problem with page caching. I have tried numerous things like "header (no-cache)" and unsetting the variable I test to see if the user is logged in all to no avail. I could test for a session variable but as with the header option - i am developing a template to be used on multiple websites and I don't want to require a session_start at the top of each page. I would prefer to keep my solution self-contained in the header.
The result in the browser when go to counter.php page has been viewed 1 times, But refresh the page or close the browser and go to the link again.The num_views does not get updated in the database, it still remains at 0.
I wrote a small .php script that creates a cookie on my local PC - I also wrote one that deletes it.
My question is this: when the cookie has been created and I run the delete .php script, when it first loads it does not delete the cookie - I always have to click on the browser refresh button - why doesn't the script execute on the first execution?
What are best practices to check to see if a .php script is called for the first time versus a user hitting a refresh button on their browser? I am playing around with a PHP front-end to a database. If the user enters values in a form (form.html), hits submit, the PHP script (insert.php) puts the submitted fields into the database as intended. insert.php displays a success message if successful or an error message otherwise.
If the user hits the brower refresh button while at insert.php, the data is re-entered, and I end up with a duplicate entry in the database. This is the default behavior of Opera. IE prompts if I want to resend the data vs. not doing anything. If the data is resent, then the duplicate entry happens. I need to guard against this either way.