Sleep() And Browser Load.
is there a way to get around the browser continually acting like they are loading when using sleep()? It says the page is still loading but it really isn't because we are causing a delay for some data on purpose with php.
So it is for an intentional reason that we cause it. Many of us like using sleep(). Anyway to do it without the browsers showing the page is still loading? There must be a way, so many programmers for intense programming use sleep(), I can't imagine they have to deal with the browsers loading prompts whenever they do.
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 !
Header Function To Load The Page It Is Directing To In A Clean Browser
Is it possible using the header function to load the page it is directing to in a clean browser. I have a member site which has an area using five frames, when there session expires they are redirected to the login screen, at the moment it just loads in the frame which calls it. Is there a way to just force the closure of the frames?
View Replies !
PHP Sleep()
I've been sitting for quite a while now, reading the sleep() manual and tried to turn the code upside down and inside out but nothing helps... I want the current page to wait a few seconds before it is directed to another ( after a successfull registration ). So i thought the best way to do that is to use sleep(). However, this does work to a certain point ... the current page waits for 5 seconds, but the text I want to show the user in the meantime doesn't show? Why? Without the sleep() and the header() it shows without any problem. Code:
View Replies !
Sleep()
I tried to make a script which would print a line of text at 1 line per second or whatever time i put. So i went ahead and tried this. PHP Code: echo "Passwords match."; sleep(1); echo "Passwords match."; sleep(1); echo "Passwords match."; sleep(1); echo "Passwords match."; This is a example and the text in echo has no meaning. However the sleep waits and waits for all the other sleeps to finish and then prints out all text at once.
View Replies !
PHP Messaging And Sleep
I would like to get my php script to send a message to a user for example to notify that a DB update or insert has been successful or not. After that the script will be redirected to the home page. how can this be done ? I have tried using sleep(5) to delay the script but that does not work the way that I want it to since it simply delays the execution of the ENTIRE script RATHER than a part of it !!
View Replies !
Sleep() In The Background
how much the sleep() which is set to no limit can consume the system resource. Could it cause to hang the server? I tried the following and couldnot see the server got busy. Although the browser seemed to be so, if I access to a different page, it responded very quick as usual. It's not a big deal, is it? sleep.php PHP Code: <?php set_time_limit(0); sleep(0); ?> fork_sleep.php PHP Code: <?php $str = "php -f sleep.php"; exec("$str > /dev/null &"); ?>
View Replies !
Fsocketopen & Sleep
I'm trying to setup a fsocketopen script to ping a site every 15 minutes or so and if the site is down, send an email. I'm thinking of using ignore_user_abort() to run the script in the background and sleep() for the time intervals. I'm not really sure how to script this out.
View Replies !
Sleep And Max_Execution_Time
I have the following code: $i=0; while($i++<15) { mail("rantsh@hotmail.com",date("d m Y H:i:s"),"This is email # $i "); echo "mandado $i <br>"; sleep(60); } Now, I know my server has a 30 second max_execution_time setting... nonetheless, this code runs successfully!!!. Now, this is actually better for me (for the application I need to run)... Yet I'm concerned of why it's being allowed to run for 15 minutes if max_execution_time is set to 30. Code:
View Replies !
Would I Use Sleep To Delay
I am making a site for a friend, but with his PHP it always renders too quick and I would like it to wait a bit for the rest of the page to load, otherwise its a bunch of annoying gaps and whacked alignment as the CSS and images load and it all just looks annoying as it loads. And it takes away from the order of of information outputted as it goes through the PHP when your focused on the tripped out layout.
View Replies !
Sleep Function
I'm playing about with delaying results of a PHP program. I want to print some results then wait for a few seconds and print some more. I have found the php sleep function however have a small problem. <?php echo ("The time in 3 seconds from page loading: "); sleep(3); echo date('h:i:s') . " "; ?> The above script is meant to print the top line, wait 3 seconds and print the bottom line. Infact, it starts, waits 3 seconds and prints all at once. Now from my understand from php.net it should not sleep untill it hits the sleep command in there.
View Replies !
Sleep For 10 Seconds Help
I am trying to run it will load an iframe for every entry found in my DB, I am trying to make it sleep for 10 seconds between each iframe with: PHP Code: sleep(10); PHP Code: $train = "<table width=800 bgcolor=F0F0F0 aling=center><tr><td colspan=4> $pages<br></td></tr>"; $i=0; while ($addall = mysql_fetch_assoc($res)) { Â Â Â Â if ($i/2 == ceil($i/2)) $train .= "<tr>"; Â Â Â Â $i++; $train .= "<td width=120 valign=top><BR><iframe src="potspace.php?u=$addall[intId]" width="400"></iframe>"; } $train .= "<tr><td colspan=4><br><br> $pages<br><br></td></tr></table>";
View Replies !
Session Timeout, Use Of Sleep Ect...
I have a custom script that uses sessions to track UID's. The only problem I have with the script is that the session times out in 1440 (min?) which I believe is 24 min. I was thinking that I could use php's sleep to hold off from doing a refresh until minute 20. Unfortunately, I have also read that using sleep can leave a server open to a DoS attack. I do not have access to the php.ini file to be able to change the timeout variable for the session. What is the best way to keep a session open without changing the .ini variable. Is sleep a good way do go about it, and if so, are there significant security risks in using sleep()?
View Replies !
Sleep() Affects The Variables?
could it be that the sleep() function affects my variables? When I set a very long delay time (1-3 hours) in my CronJob PHP4 script (of couse with a big set_time_limit) some of my variables go lost! But there's no problem with short times in the sleep-function (1-5 min). set_time_limit(86400); for($x=1;$x<5;$x++) { echo $x; //$x will be shown only one time sleep(7200);}
View Replies !
Need To Flush Before Sleep But I'm Blank.
I'm new to php and am converting a bunch of asp pages to php. Current problem : I am using a Submit button on a form to POST ( send the database variables ) to a php page that will send a personalised e-mail to each client. On the php page, I am looping through a database, compiling a message ( html format ), and mailing the message to my client. After the mail has been sent, I need to wait for 4 seconds before continuing with the next database record. I am using this code after the mail has been sent : echo "Mail Sent to : " . $row['CliName']; ob_flush(); flush(); sleep(4); Problem is, that nothing appears after I click on the Submit button on the first page's form ( the first page just remains on the screen ). Once the database has been looped, the entire (correct) output appears on my screen - but I need to see some sort of progress as it works it's way through the database.
View Replies !
Sleep(900) ? Delayed Query... ?
Trying to set a marker in a MySQL table on our Primary host (WAMP stack) indicating whether or not there is current User Activity -- ON THAT SERVER -- as a signal to remote Secondary -- tablet pc based servers to skip scheduled database synchronization with the Primary. Code:
View Replies !
Staggering Execution With Sleep()
For my site, currently in development, I will be hosting some latest RSS picks from friend websites. To start with there will only be a couple, but eventually I hope to be sourcing from up to 50 partner blogs. Obviously, i dont want to make a request on every page load, so I would instead cache data from the past half hour/hour. I will be using CRON to schedule an update every so often, but having a single script making 50 requests one after the other then processing and storing the data may be taxing, especially if the outside server is slow. I thought about using sleep() to leave gaps between each request so that a sudden hogging of resources doesnt happen every hour. What are your views on this method? Is it feasable (and possibly even a good idea), or should I just get it all to execute in one go?
View Replies !
Resources Used When Using The Sleep() Function
I want to use the Sleep() function in a script that may run multiple times, but i dont want hte system to crash or be overloaded with scripts in memory. When the script enters a sleep mode, what happens to the script? is it resident in memory? if so could i experience the system bogging down if there were 100+ scripts resident in memory or are they just sitting there doing nothing until they run again?
View Replies !
SLEEP + Header Problem
I'm running a community website where I send out weekly newsletters to all of my clients. However, I'm sure my hosting provider wouldn't be so happy if I just FOR LOOP and send it all out at once. SO what I did was I just a SLEEP and a header mthod that triggers after every second, where the header sends out GET variables for the next iteration to fetch at which account I am currently at to send the next newsletter. Code:
View Replies !
Insert Sleep Every X Rows
i am trying to insert a sleep command in my loop every 100 rows, the below works for every 2 but if i try to sleep every 100 rows it will not work. if($i % 2) { sleep(5); } does not work [php] if($i % 100) { sleep(5); } [/php
View Replies !
Long Sleep() And Time-out's
The script I'm writing needs to wait a random amount of time (1-300s) between each iteration of a loop, eg. while(condition) { do something //wait between 1s and 5 minutes sleep(rand(1,300)); } Problem is, a browser times out if it doesn't get an answer within about 30 seconds. Is the idea of having a PHP script sleep for a longer amount of time incompatible with web applications? Any work-around?
View Replies !
Putty Processlist Command Sleep
I'm using php with mysql. I am connecting through putty and I run the command for processlist. Lately I am seeing many threads with the command "sleep" in them. My site and the database are running smoothly, but I am seeing up to 200-300 threads like this with the command "sleep". Can anyone tell me what may be causing this and how do I resolve it? Or is it normal to see this when your site grows to a certain size? Code: ......
View Replies !
Require_once And Fatal Errors... Automatic Sleep And Try Again Anyone?
I have a PHP page which loads OK 80% of the time. However the rest of the time I get the following error: Fatal error: Failed opening required 'DB.php' This really bugs me, especially since the only reason this is happeneing seems to be due to server load. I would like to add code so that instead of displaying the given error, the PHP code makes the HTTP response thread simply sleep a little bit (say 4 seconds), and then retry, and repeat until the file can be opened. It seems strange to me that server load would prevent the file from being opened. Anyhow, any ideas on how I can improve the situation?
View Replies !
How Can I Load Load Additional Extensions ?
My OS is Winxp . My web server is apache 2 which is installed as a NT service . My php version is 4.32 , and I extracted it into "c:php" . I run php as a apache module . I want to load Additional extensions .They are php_mbstring.dll, php_xslt.dll and php_domxml.dll . I have made changes to php.ini as follow. extension_dir = "c:phpextensions" extension=php_mbstring.dll extension=php_xslt.dll extension=php_domxml.dll then I restarted apache2 . but it told me that the modules could not be located .
View Replies !
File_get_contents - Making A Browser Within Browser
im making a browser within browser (dont bother asking why), but the problem is when i use file_get_contents, it works, however, the original HTML doesnt use absolute locations of images etc... so it tries to look for them on my server . I tried using str_replace to change it but i cant distinguish between things which are relative and absolute references...
View Replies !
SHOW PROCESSLIST "sleep"
when i view SHOW PROCESSLIST i always see command sleeps with some large times behind them.. can somone please tell me what that is and what that might be caused by? "Command" Sleep "time" 1585
View Replies !
Load Dll
Is it possible to store some functions into a dll file and load that dll as a php extension? Id yes, how?
View Replies !
Load .js
Does anyone have a php script I can use to load a .js file into a html page like its done for images? Iv'e seen this for IMAGES, but what about other type files? SRC="images01.php?image=p_clr.gif
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 !
Does PHP Load All The Extensions In The PHP.INI..
I am using Windows IIS with PHP5 CGI. When I want to use an extension in PHP5 under Windows I enable the extension line in PHP.INI. (e.g. extension=php_sqlite.dll). Does PHP load all the extensions in the PHP.INI on every invocation of a request? If I have 20 different extensions not all of them are used on every page request. Is this inefficient? Would using dl() be more efficient? And why is it being depracated under 5?
View Replies !
Getting PHP To Load Up Images
I'm storing images on a separate drive than that that has PHP running on it. PHP (the group www) has permission on that drive to read files and so on, how can I get PHP to load that image into a web browser? Even better, how can I get PHPThumb to interact and use that image?
View Replies !
Cannot Load Excel
I want to load excel. However, this simple code doesn't work. When I open this page, there's nothign happen, not even 'unable to initiate excel" or othere error message. I have excel in server. Do you know why it doesn't work? Should I make some special setting? <?php $ex = new COM("excel.application") or die("Unable to instantiate excel"); echo "Loaded Word, version {$ex->Version} "; ?>
View Replies !
Form Should Load First..
I am running a script which sends an email first then shows an html form. But here what happens, it is taking so long to load the html form because of the mail function. Once mail function executes, the form loads. I want to run the mail function behind the scene and show the form first. I have tried with the php flush() also. Can anyone please help me regarding this. I want to show the form first instead of waiting for the mail function to finish execute.
View Replies !
100% CPU Load : How To Investigate?
Someone I know is running some Web 2.0-type web site that lives on a shared host, and is experiencing 100% CPU load after a few hours. At this point, his provider couldn't tell if it's due to a DoS attack, or a bug in his application. 1. For the DoS thing, I assume looking at the log files should be enough to tell if it's the problem is due to a suspicious rise in the number of connections at some point. 2. As for bugs, are there tools available for PHP that can monitor an application and reveal bugs that could explain this CPU load?
View Replies !
Load Xml From A Php Script
i have an swf file that load xml data from a php script. when i run directly this swf this works well and load de xml data. but when i tray to load this swf as a clip in other swf then it does not load the data, it read the header of the xml file and nothing more if i change the php script for static xml file (same output that produces the php script) work in both cases any idea?
View Replies !
How To Minimize DB Load?
A friend is running a community application in PHP on a shared server, and his provider is complaining that it's using the DB too much. Apart from making changes to how data are organized in the DBMS, are there ways in PHP to minimize DB load, eg. caching data instead of reading/writing them from/to the DBMS every time, etc.?
View Replies !
Can Not Load Php_ming.so
I try to install php_ming.so in my php . I am using Redhat 8.0 php 4.2.2 apache 2.0.4. I am doing as the howto install file want me to do. as follow. http://ming.sourceforge.net/install.html ------------------ download php_ming.so.gz uncompress it and copy it to your php modules directory (you can find your php module directory by running php-config --extension-dir) Now either just add 'extension=php_ming.so' to your php.ini file, or put 'dl('php_ming.so');' at the head of all of your Ming scripts. ----------------------- but apache or php can not load php_ming.so. How can I fix the problem?
View Replies !
Auto Load
I am tring to figure out how to do something. I am starting to build a collection of coomon used php class, kind of a framework but not really, that i will be using for all my site. For instance i have a database class that handle all mysql database stuff. I have a site class that handles html stuff(generating header/footer, form elements, etc.., i just have all these classes included in 1 folder but it is starting get big and i would like to be able to start searating them with folders. the problem is how can i tell the auto load where the class is without changing the name of the class?
View Replies !
MySQL Load With PHP
Would a medium sized (~500 pages) database driven website, search engine and mailing list be too much for one MySQL database? Instead of making using different databases I would use different tables. I would use PHP for all of this.
View Replies !
Load Url Into A Frame
I have a database with url's in it, and I want to load one at random into a frame, when a link is clicked I want to load a new random url into the frame I can do everything except load the new url into the frame, how would I do that?
View Replies !
Load Text
I want the user to fill out a textbox and have that text upload to a webpage. Like a news announcement , the user can enter in what they want to say and then send and it appears underneath other text entries (using php/mysql). Now the problem is mysql seems to have a limit on what you can store , especially on the server that hosts my mysql (250 chars limit). I want 500-1000 words max so what can i do?
View Replies !
Load Time
I have a fairly simple php Load Time script that makes use of microtime(), but I was wondering how to make it more acurate. The load time is thousandths of a second, when the actual page isn't visible for 5 or 10 more seconds. Are there any other php options for doing this? I was thinking perhaps buffers, but I don't even know if that would work.
View Replies !
Load The Contents
I want to be able to load the contents of a text file into a couple different form fields. So like title and body would be two different input fields. The script would somehow seperate the title and the body in the text file so it can be redistributed to each input field when I go to edit it. then be able to change it and then hit the submit button to overwrite the old contents with the new contents.
View Replies !
Getting Images To Load
I had a PHPNuke site a few years ago and had no problems maintaining it. I recently signed up with a host and they have fantastico so I had them install the PHPNUKE automatically. I am having trouble with images. When adding a new 'article' I can add an image and it shows up but when I 'preview' or 'post' the image won't show up. I am hotlinking through photobucket just like in the past. Does that make a difference? Same thing when making a block. All the other HTML works but I can't load images. On 'Topics' icons I have to change the files from jpg to gif in the directory to get them to work. Is there something I am doing wrong or does it sound like I have a bad script somewhere?
View Replies !
PHP Load Process
I've tried searching around for information on how PHP parses and renders itself. Basically, I'm writing a bunch of scripts that rely on a core file. The core itself is quite large (around 20k), but the scripts that reference it don't often utilise the entire contents of the core. Inside the core are functions that are never called *inside* the core, and a bunch of constants and globals that I call from the referencing scripts. So I guess in a nutshell, I want to know if when I call require, does PHP read the *entire* file? Or does it only read the bits it needs? I realise that last sentence makes me sound like I have trouble putting legos together, but I would just like to know how PHP goes about it duty.
View Replies !
|