FORCE Page To Load
On my main server, I have an html page (begins with <html> and ends with </html>. After the last </html> part, I have a short bit of PHP code which connects to a mysql database on another server. Yesterday, that other server was, "down," for a while (i.e. mysql wouldn't work). During the downtime, my main page wouldn't load! Visitors would see a blank page. because my php code at the bottom was trying to connect to the down site.
I have tried everything I could think of. I even tried "Set_time_out()" ... but that won't work because my shared server's host has safe mode on. My php mysql code starts with:
$link = mysql_connect etc.
if (!$link) { die(); }
...but that doesn't work either.
how do I "force" my html page to appear to my visitors regardless of whether php is having any luck w/ the mysql connection?
View Complete Forum Thread with Replies
Related Forum Messages:
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 Replies !
Force A Refresh Of The Page?
Internet Explorer is making me crazy. Things that works OK with FireFox, does not work properly with IE. Situation: PHP script A have a link to a PHP script B. Script B changes some $_SESSION variables and then do a re-direct back to script A. With FireFox, the page is refreshed when I click on the link to script B and the results have be seen. But with IE, the page is not refreshed, so the changes made due to changes in the session variables, is not visible for the user. I have to press F5 or click on the Refresh-button in the toolbar to make the changes visible. Any hints about what I can do to force a refresh of the page?
View Replies !
Force A Page To Be Re-validated?
I'm trying to force a page to be re-validated every time someone views it, even when they click the back button. I'm currently using: header("Expires: " . gmdate("D, d M Y H:i:s", strtotime("-1 year")) . " GMT"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: no-cache"); However, my pages still seem to display without the server being called when the back button is pressed. Can anyone suggest the correct headers/code I can use to force the server to be re-called when the back button is pressed?
View Replies !
How Do I Force A Page To Be Re-validated?
I'm trying to force a page to be re-validated every time someone views it, even when they click the back button. I'm currently using: header("Expires: " . gmdate("D, d M Y H:i:s", strtotime("-1 year")) . " GMT"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: no-cache"); However, my pages still seem to display without the server being called when the back button is pressed. Can anyone suggest the correct headers/code I can use to force the server to be re-called when the back button is pressed?
View Replies !
Force Email -> Download Page
I'm looking for some code that will force someone to enter there name and email address (logged to a .txt file, no dupes?) and if correct, will send them to a page where I will put a download link on it. I searched around through a ton of download scripts, but didn't find any this simple.
View Replies !
Force Download Is Getting Contents Of The Page
I'm writing a file to the server using fwrite, and than once it's written, I want an open/save dialog to popup so that the user can download the file to their computer. The problem is this: the file that you save in the open/save dialog box has the contents of the file PLUS the html contents of the PHP within it. Obviously not ideal. Code:
View Replies !
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 Replies !
Cookie - Page Load Or Page Refresh
this is supposed to show file1.txt, then file2.txt and so on on page load or page refresh. But it only shows the first 2 txt files. Can someone help me find out why? I would think that as long as the cookie is still the same if (isset($_COOKIE['e'])) { setcookie("e", $a++, time()+60*60*24*30);} that it would go to the next text file but its not. Please let me know, thank you very much. <?php $max_files = 12; $a = 0; if($a == 0) {setcookie("e", $a, time()+60*60*24*30);} /* expire 30 days*/ if (isset($_COOKIE['e'])) { setcookie("e", $a++, time()+60*60*24*30);} if ($a == $max_files) $a; $include_file = "file" . $a . ".txt"; include ($include_file); ?>
View Replies !
Using PHP To Load Another Page Or Html Page
Ive got a PHP script, which if it ends correctly, i want load another PHP file or an HTML page automatically, ie without user intervention. The new page shoud replace the current page on the browser. Is there a PHP command or function which does this?
View Replies !
Page Load For IP
Is there any way only a certian IP address on our network can see a particular Table on the page? or if a certian ip Adress goes to our intranet page load a certain page depending on that IP address.
View Replies !
XML Page Cannot Load
I have very special case, i tried fopen, fsockopen, in php, then wget , get, on linux, but never had success, i want to download content of external xml file, it's not just stored xml file, it's php file that outputs xml page , i need to tell that php script 2 arguments, thats it. i can't see why i everytime i try to grab it, get binary data, i can see it in my IE ok, but when try any php script it gets as binary code. can anyone tell me what i'm doing wrong?
View Replies !
On Page Load
I am fairly new to PHP and have the following problem: I need some help with the coding for PHP includes. I am trying to get a simple include: <?php require("nav.php") ?> to load after the page itself has been completely loaded. Do I have to use the sleep() function for that? If yes, how exactly would my coding have to look in order to work. The reason I would want to have a delay in a PHP include, is because I would like to have the basic page load first, so the visitor can start reading, etc. and then have some larger files load while the visitor is reading. I assuming, this would decrease page load time by having larger items load while the basic page has already been loaded.
View Replies !
Page Has To Load From This Url
I have a page that is supposed to be secure, but I need a way to make it so if the page is accessed without https, it will reload with https. <? if(substr($_SERVER['SCRIPT_URI'],0,5)!="https") header("Location: https://url"); ?> someone gave me this code to try but when I do so, the page just tries to load indefinitely.
View Replies !
Incrementing On Page Load
I have one form that I want to send email. Instead of using multiple pages, I have condensed it to one. However, I don't know how to increment a value, say "display", each time the submit button is clicked. For instance - I have $display = "1". I want 1 to increment to 2, 3, and so on once the user clicks submit once, twice, etc. But I only want the "validation fields" to show after the user has clicked submit.
View Replies !
Set Time To Load A Page
I want to make a page which take time almost 60 seconds to load the contents....means a script in php which sleep for a 60 seconds and then execute the next part....
View Replies !
Page Load Frequency
I need a function to prevent a page from being loaded too often too fast. So say, one is only allowed to refresh a single page 5 times in 10 seconds, or 10 times in 5 seconds (or whatever ... ). If the load frequency exceeds that, the site calls exit(); And a message is displayed. Just like Expression Engine does ... This way i want to protect the DB from being queried rediculously often, and maybe even protect it from DDOS attacks. I hope it's clear. I don't know where to start ..
View Replies !
Redirect If Page Does Not Load
I have a form that will not submit if certain data cannot be found in Mysql or it will take very long to submit. Is there a way i can have the form go to an error page if it does not submit or load results in 5 seconds. If it does take long i need the following: $msg[] = $error10; header("Location: quote_error.php?");
View Replies !
Never Ending Page Load
When I run this script, it tries to load but after aout 10 minutes the whole browser locks up because it can't do it. I have a hunch it is because the while loop doesn't ever stop, but I don't know how to prevent it. Code:
View Replies !
Page Load Time
I have a php/html page that is taking longer to load then i think it should is there a way to see what part of the page is hanging it up?
View Replies !
Php Page Wont Load
I uploaded it to a server and what the goal for this basic class is to have the form submit to the php page. once i click submit on the form page (<form name="form0" method="post" action="formpost.php"> ) Code:
View Replies !
Load Custom Page
I have two pages named index.htm and page.htm. Page.htm has an iframe. I want to open page.htm from index.htm with a specific page in the iframe for each link. How can I do that?
View Replies !
Load Page Then Read
Is there a way to completely load the page of its HTML elements then read all those elements into a string? For example, I have a PHP page that get its HTML content from the database. I want that page to completely loads, ie., get the content from the database, then write all of that page's text and html elements into a string so I can modify it (ie. remove all the links) to display it in another page.
View Replies !
Load / Save Page
Im looking for some information if its possible, maybe a link or two. Im wanting to show the user a page that lets them know that their data is saving or their data is loading, while php runs its functions. Then when the information is processed then redirect them. As it works now it just takes a few seconds where is looks like the page is frozen then redirects as it should. Im not even sure that this would be done in php, but i figured yall could shove me in the right direction.
View Replies !
Load A Specific Page
I now have a simple php stylesheet switcher. I will expand on it as my 'kung-fu' gets better,(using some of the ideas you guys posted in that thread), but for now, it will do. Onto my next quandary. Is it possible to always load a specific page or the same page into the browser every time a user returns to my site? I know you can use redirects to push them in a certain direction, but they look a little unprofessional. I'm looking to create something a little more seamless, and a hell of a lot more classy.
View Replies !
Load External Page
I'm looking for a simple way to load an external web page inside of one of my pages, but it would need to be server-side, as in not frames or anything else client-side.
View Replies !
Want A Different Page To Load According To Checkbox
I have been trying to resolve this for a couple of days and I have tried using info I found on this board, but I am getting no closer. I have a form with a single checkbox. If the user checks it, I want the orderthanks incl. to be returned. If they do not check it, then I want orderthanks2 incl to be returned. I am trying the isSet statement below. If I do it this way then it always loads the first inc. file. If I try it with just the second if statement alone, then it returns the 2nd include, but not the first. When the box is checked the value returned is 'on', I have tried it using that as well, does not work. I am sure there is something simple that I am missing. Code:
View Replies !
Load Image Into Self Page ??
I have a bunch of pages which are all loaded into the index page by the code: index.php?id=about (etc for other pages) - which then loads the relevant page into the index template. Works fine. Now say when I load that 'about' page I want to load several different images when the user chooses whilst 'staying within' the 'about' page state. How can I do that ? I feel the link code must be something like: index.php?id=about&image=one index.php?id=about&image=two index.php?id=about&image=three etc, but I don't know where to start with declaring my image variables or where to put all this code.
View Replies !
Make PHP Page Load
I have a PHP page with a mySQL insert statement at the top. If there's any mySQL problem (e.g. locked tables, database error, etc.), I'll only get a blank page in my web browser. How do I code it so that whether or not there are mySQL errors, the PHP page will still load normally.
View Replies !
Random Page Load
I have a page setup with an iframe. What I am trying to do is to load one of 3 features in the iframe. The iframe is: Code: <iframe src="featured1.html" name="player" id="player" scrolling="no" frameborder="0" height="316" width="490"></iframe> I'd like it to load either: featured1.html featured2.html featured3.html
View Replies !
Canīt Load Page Before Refresh??
Why my pages donīt appear after linking to them (.php3), I have to Refresh the page and then it appears. And of course I loose the passed information from previous page??? This is REALLY bothering me A LOT. Please, does anyone know the answer???
View Replies !
Submit Vs. A Fresh Page Load
I'm developing a page - mostly for the learning experience - that includes a form with several text fields and a submit button. When it's submitted, there is some server-side processing and the output is displayed as part of the same page. (the form's action attribute is set to: "<?php $PHP_SELF ?>"). One of the steps in the PHP script is to check for the existance of a hidden element in the form so that I know whether the page is being sent out as a result of a new request or from the form having been submitted. This all works as expected. When the page is sent out as a result of having been requested from its "home" page, the results are not shown; when the submit button is clicked, the page is sent out with the results shown. Finally my question: when viewing the page with the results shown, if I press <F5> or click on "Refresh", it behaves as if I had clicked the Submit button (that is, it shows the results). I would expect it to return the page as if it was a new request (and NOT show the results).
View Replies !
Page Load Time + Iframe
There is any way to get the total load time of a page when you get an "IFRAME" on it? In all the tests, I got only the base page time without the "IFRAME" time.... <?php $bench = new phpCounter(); $bench->StartCouter(); $page = "<iframe class=......"; echo $page; $bench->EndCounter(); echo $bench->GetCounter(); ?> Where: // StartCounter() & EndCounter() call this function function SetCounter ( ) // {{{ { list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } // }}} // Function to return the counter function GetCounter ( ) // {{{ { $output = ($this->end - $this->start); return substr($output, 0, 5); } // }}}
View Replies !
Set_error_handler: Page Does'nt Load
I've written a custom error handler and it works as it should on my development server(mac OS), but when I try to use it on the live server(freeBSD: PHP Version 4.0.1pl2) the pages that use set_error_handler("my_error_handler"); won't load. Is there some configuration setting that would prevent me from using a custom error handler?
View Replies !
Create A Pop-up (on Page Load) On Certain Dates
I'm new to PHP, and i want to create a pop-up (on page load) on certain dates.. What i have is the script for the pop-up: <body scroll="auto" <?php $today =date("d-F"); if ($today==$datum) {echo "onLoad=".$g_birthday_pop;}?>> The pop-script = $g_birthday_pop = <<<EOT "MM_openBrWindow('http://www.nu.nl','popup','width=300,height=300')" EOT; $datum is in another file (include/datum.php): <?php $datum= "30-December"; ?> And this works if the date is 30th of December, but i want it too on other dates that you put in $datum Something like: <?php $datum= "30-December";"10-March"; ?> So i want to control the pop-up just by editing the "datum.php"-file
View Replies !
Load Page In Middle Without Anchors
i am using php and have an "update.php" page that is a long list of input forms for an admin user to update database entries. each entry has its own "update" button. so when the user edits an entry and clicks "update" s/he is directed to a processing script which updates the database and returns the user to "update.php". heres my problem: the user is returned to the top of page (which is fairly long) so they have to scroll back down every time if they want to edit a number of subsequent entries. i would like the "update" submission to somehow save the current page view so that the user is returned to precisely the same scrolled down view as before. can this be done without anchors? i know i could use anchors but am i right that this would cause some scrolling up or down to the nearest anchor in general? i would prefer some way of doing it by percentage, pixels, etc so as to cause a sort of transparent departure and return to the page.
View Replies !
$_SERVER['argv'] Doesn't Have A Value On First Page Load.
when i first load index.php with arguments ie: "index.php?page=x", the $_SERVER['argv']value is null. I then get the session id appended to each link. If i refresh the page, I get the $_SERVER['argv'] I want, but if i click a link $_SERVER['argv'] returns the value I want and the session id. Any ideas as to how I can get the $_SERVER['argv'] to return the arguments on first page load?
View Replies !
INSERT Data On Page Load?
I have an avatar system where certain avatars are locked until the user unlocks them by going to certain pages of the site. So far ( being the newb I am ) I only know how to INSERT data from a form. Is there a way to do it on page load or similar? I also need it to first check if the data already exists and if not it inserts the data and then displays a message to the user that they have unlocked the avatar. Code:
View Replies !
Curl Load Page That Has Variable In Url?
I'm trying to load a page that has a variable in the url. Such as: index.php?name=bob I tried acting like the page was just a normal page (such as index.php) but that didn't seem to work. How do I give the server the variable in the url?
View Replies !
Submit Information Before Page Is Load.
I have a page with the some user information. The function in the pages gets the username and returns some result from a database.The page uses a template. When I link to the user page I used: http://...../mypage.php?username=[username] That link works perfect, the user gets his information with no problem. But if the user reaches the page directly. http://...../mypage.php Then the user gets the first rows from the database. Code:
View Replies !
Screen Automatically Load A Different Page
I have a php page which checks a number of form fields to ensure that certain conditions are met. this is pretty much done and works very well. If the conditions are not met, the errors are displayed on the screen. if the conditions ARE met, I want to be able to have the screen automatically load a different php page. I have scrolled through a number of posts on this forum but haven't found what I'm looking for yet. any ideas?
View Replies !
Upload Script - Cannot Load Page
I have an upload file script which use to work fine. Old server crashed, now it's on a new server. The script works fine with small files, but just doesn't load after submit with large (20meg) files. It timed out after 4 minutes, still higher than the default server value. The script settings are enforced by a .htaccess, see below for some settings. PHP4 max_execution_time: 12860 max_input_time: 12860 post_max_size: 55M upload_max_filesize: 52M Is there something I am over looking? Perhaps you have some troubleshooting advice?
View Replies !
|