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.



ADVERTISEMENT

Making A Function-Activated Link Appear Without Having To Refresh Browser?

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?

index.php:
PHP Code:
<?php 
require_once "header.php"; 
//content

[Code]....

View 2 Replies View Related

Refresh Browser To Refresh Site - Fatal Error: Maximum Execution Time Of 60 Seconds Exceeded In

this is the first time that i've come across such error. When i tried to refresh my browser to refresh my site, the computer starts eating up my ram, and this error came out about 2 minutes later:

Warning: mysql_query() [function.mysql-query]: Unable to save result set in D:Dropboxhtdocsercygestionabonnes_amanfunction_search.php on line 64

Fatal error: Maximum execution time of 60 seconds exceeded in D:Dropboxhtdocsercygestionabonnes_amanfunction_search.php on line 64

The problem can be solved if i comment out both these part:

Code: [Select]LINE 64: $result = mysql_query($sql_query) or die(mysql_error());

but, these errors came out:.....

View 5 Replies View Related

Force Refresh

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.

View 2 Replies View Related

How Can I Force A Refresh When They Make A Change.

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.

View 10 Replies View Related

Force Refresh On Ajax Request?

I have a script which at one point returns an image thumbnail using jquery built in java request.

Every time the php function get called, this thumbnail gets updated, but keeps the exact same filename. Problem is that the browser caches the thumbnail and it looks like it never gets updated.

View 3 Replies View Related

Force Browsers To Not Request Resource On Refresh?

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?

View 2 Replies View Related

WWW-Authenticate: How To Force Password Login At Every Page Refresh ?

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

-->

<html>
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<?php

$showall = false;
error_reporting (E_ERROR);

if (($PHP_AUTH_USER != "myname") || ($PHP_AUTH_PW != "mypass"))
{
header('WWW-Authenticate: Basic realm="Secure Login"');
header('HTTP/1.0 401 Unauthorized');
$showall = false;
}
else
{
error_reporting (E_ALL ^ E_NOTICE);
$showall = true;
}

if (!showall) {
echo "access denied";
} else {
?>

................

</head>
<body>

.................

<? } ?>

</body>
</html>

View 2 Replies View Related

How To Stop Jpgraph (gd Library) From Caching Or To Force A 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?

View 4 Replies View Related

Force A DOM Refresh When Running Multiple Ajax Tasks In A Loop?

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
}

[code]...

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

View 1 Replies View Related

Can PHP Force A PDF *NOT* To Load Into A Browser?

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.

View 3 Replies View Related

Force Browser To Download?

I'm using a .htaccess file to make links to JPEGs download instead of opening in the browser window. This is what I'm using:

AddType application/octet-stream .jpg

It's working fine in Safari and Firefox on Mac OSX but not on IE 8 on Windows. Is there any way around this apart from writing a header in PHP which I would rather not do?

View 4 Replies View Related

Force Browser Download Of Content

Ok, this isn't a "How do i force the browser to download my file..." question.

This is a bit different because what i want to give the user isn't a file.

I want to provide a copy of a database table as a CSV file.

View 1 Replies View Related

Force Download From A Browser Link Using FTP

Ok, so i know how to force downloading in a browser using:

header("Content-Disposition: attachment; filename=x.avi");

But... what if the file isn't on the webserver, but on a remote FTP server.

So, I have a link like this:

<A HREF="ftp://userass@blah.net/video/x.avi">click here</A>

And of course if you click on it Windows Media Player launches and it tries to play. How can I force the download?

View 5 Replies View Related

Force A Browser To Cache Image?

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?

View 3 Replies View Related

Force The Browser To Prompt For Download Of The File

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?

View 7 Replies View Related

How To Force Browser To Reload Image From Server?

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:

View 4 Replies View Related

Force A Browser To Show The Latest Changes To A CSS File?

I made some changes on a CSS file on a PHP site.

The changes do not show up in any browser I test it on until I hold down the CTRL key and click the browser's REFRESH button.

This means that most users are not going to seem the changes I made.

How can I force browsers to show the changes to CSS files immediately (without renaming the CSS file)?

View 3 Replies View Related

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

Force Browser To Re-request Page After History.back()

I've got two scripts: 1.php and 2.php. Here they are:

1.php
<?php
header('Pragma: no-cache');
header('Cache-Control: max-age=1; no-cache');
header('Expires: Tue, 1 May 1985 01:10:00 GMT');
header('ETag: "'.md5(rand(1, 1000)).'"');
[Code]...

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.

View 1 Replies View Related

Force The User To Download A File From A Href Link Rather Than To Open It In A Browser Window?

Basically I wrote a script that generates a xml file based on user input. After the file is generated a download link appears like so:

<a href="path/to/file.xml">Download File</a>

But when clicked it opens the xml in the browser, I want it to start downloading when the link it clicked instead.

View 5 Replies View Related

Browser / Refresh

is there any way to force a refresh of a page that a user visits?
sorry i am still learning.

View 4 Replies View Related

A Browser Refresh

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.

View 7 Replies View Related

Preventing A Browser Refresh

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:

$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/');
$extra = 'dummy.php'
header("Location: http://$host$uri/$extra");
ob_end_flush();
exit;

Finally, the dummy page has a single header command to reload, sans $_POST variable, the main page.

View 6 Replies View Related

Refresh Browser Remotely From Server. How????

Just wandering how can you close a browser remotely. In some web
applications the browser closes or refreshes periodically.

How is that done and how can it be done through PHP?

View 4 Replies View Related

Browser Refresh On New Database Entry

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 was wondering if this can be done in php? (I'm very doubtful) but im sure it can be done somehow using JavaScript or AJAX? (which i know nothing about). If possible can anyone help with this. I have my website coded in PHP so if possible, i would prefer help in PHP but i'll use a different language if it makes better sense.

View 3 Replies View Related

Clear The Browser Cache And Refresh ?

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 ?

View 4 Replies View Related

Refresh A Page On Browser Back?

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.

View 2 Replies View Related

Refresh The Page In Browser To Link Again?

Code:<?php
require("/config/db_config.php");
$connection = mysql_connect($db_host, $db_user, $db_password, $db_name)

[code]...

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.

View 2 Replies View Related

Cookie Question - Browser Refresh Button

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?

View 3 Replies View Related

Handle User Hitting The Browser Refresh

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.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved