Task On A Background
I have a script that inputs/updates db from submitted form. I just added another code that sends email messages to a number of users that may be affected by the posted information. I put this script right before in run a db query and it's basically a loop that matches appropriate accounts and sends an email. Depending on how many accounts are affected it may take a little while before the pages returns back to the original one with the form. I was thinking that perhaps I could take the email script and put it into a separate page and trigger it at the same time.
View Complete Forum Thread with Replies
Related Forum Messages:
Need Buffering Or Background Task
I have a script calling another one which has a loop that is reading a huge text file (actualy 14 Mb) line by line (oin my case more than 55000) , extracts datas and makes an INSERT into a MySQL database. I optimized what i could but the script still takes about 70 s which is beyond timeout of server and browser. i also display errors when found during the parsing, so the browser must be active... At the end of the script, i display the result of the parsing (how many fields have been inserted and how many errors) Depending on browser and server, i have different results in the display. In some configuration i have nothing displayed, with others i have the first line, than nothing, etc.. To keep the browser active, i tried to send some === every x loops to show that something happens, but i'm still not satisfied. Code:
View Replies !
Launch A Background Task From A PHP Script?
For example, when a user posts on my message board, it may fire many e-mail notifications to other users, and other tasks. I want the posting confirmation page to end displaying quickly, without waiting for those notifications or other tasks to complete. So basically what I want is to launch 'background.php' from 'main.php', with the user seeing only the output of - and waiting only for the end of - 'main.php'. Without the need to wait for the end of the possibly long 'background.php', like if I had simply included it in 'main.php'. According to the PHP Manual, the function register_shutdown_function() was the solution "in PHP 4.0.6 and earlier under Apache", but "since PHP 4.1 the shutdown functions are called as the part of the request" so that PHP waits until the shutdown functions are completed before closing the connection to the user. E.g. in PHP 4.1+ this <?php function background () { echo 'Starting background task... ' // Do something long that I don't want the user to see or wait for sleep(5); echo 'End of background task. ' } echo 'Starting main script... ' register_shutdown_function('background'); echo 'End of main script. ' ?> will output: Starting main script... End of main script. Starting background task... End of background task. I want a way to output only: Starting main script... End of main script.
View Replies !
Is PHP Suitable For This Task?
I have a project that resulted eventually in a few tousands of HTML-files on the following form. file name: F1717.HTML ---------------------------- <html> .... <h1>Text to the F1717-object</h1> <img src = "../images/img1717.gif"> <embed src="../movies/f1717.mov"> </embed> .... </html> Above that i have a, of course, a few tousands of MOV and GIF stored as well. It's all more or less finished but the maintaince is a bitch. What i wish to do is to use something, let's call it MOC as in Method Of Choice, that will let me storage all data in a more convienient way. Now, to the main question - is the combination PHP/SQL a suitable choice for that task? Is there a better combination? I have a few years experience of Java but i'm rather sure that the users won't have it installed nor will the bunch be able/willing to do it.
View Replies !
Task System
I've been asked to build a task based system for keeping track of daily, weekly and monthly task that the administrators do at our office, things like change this, burn this, etc. I'm interested in thoughts on how I can achieve a stable, fools proof system. I've given this a lot of thought, and come up with the following: Two tables Tasks and instances Each task has a next run date and this is calculated when the task is entered. When the page for todays task is accessed, the list of instances is build for today, which is calculated from the next run date.
View Replies !
Create Task
how to create a task that run a query on a daily basis. Should I use PHP of should I do it directly in MySQL and how ?
View Replies !
Using Scheduled Task
I have a php code which when executed fwrites the contents into a file. That works fine. But when I use the windows task scheduler to execute it, windows a return of (0) which means no errors but the file doesn't seem to be executed. The thing is that prior to me adding the functionality in the PHP code to produce output to a file, using scheduler to run the file was fine.
View Replies !
Scheduled Task
setting up a task to run nightly? The problem at hand is, company A stores data on company B's server. Then nightly, company B creates an XML feed for them to take the updates and put them in there own database server (that I am going to set up). The website never sends updates back, the only updates from company A are from inside there office system. So, what I have to do is take this XML feed and put it in my own server. It could be a fairly large number of records (500 maybe) - So I'm not sure how fast it could realistically be parsed through and then added to the database. How do I go about this without checking each time a user visits the website? It needs to be automatic too, rather than somebody going to the specific page each night and clicking 'go'.
View Replies !
Running A Scheduled Task
I would like to run a simple php file that backs up my database. The file is in one of the virtual directories. I know I can do it with other ways, but I'm interested in how to do it on a windows OS, and using the windows scheduled tasks wizard - if possible. I've read that parameters need to be set up, but I don't quite understand what that means. how I can do this in a simple step by step fashion?
View Replies !
Strange Characters When Script Run By Scheduled Task
I've written a script that is run on a Windows server which gets headlines from a remote webpage, and I'm using a scheduled task to run it on a regular basis. The problem is that swedish characters (åäö) gets replaced with other characters.Example: Quote: Boverket sõger ja till ICA Maxi. v- och mp-r÷ster hotar budgetf÷rslaget. When I run the script from the web through my browser, it works fine. This only happens when I run it with a sheduled task.
View Replies !
Issue Tracking And Employee Task Management
I need to track down issue for each and everyone of them. I have the list of the issues they need. Maybe what I am saying is I need a script where in they can choose their name and then choose the issue they had and save it to the database. After saving to database it goes back to index.php where they can choose their name again and choose another issue and save again. And I need the issues sorted by date and by name because I will be generating a report. Task Management Same goes for the previous script. I need to manage the task for the 16 people. Each person has his/her own task (Action Items) that I need to write down under their name and track down. Once the task is done I can delete it or mark it as done or option to keep it open incase they were not able to finish the task.
View Replies !
How Would Watchers Know, Without A Cyclic Check On MySQL Schedule Table About Task Validity?
I have developed a PHP-based website where a "planner" user can make up schedules of activities to be performed, storing them into MySQL tables. Afterwards, other "watcher" users can connect to the website and retrieve closest task due time, and keep retrieving next task after each one has been performed. The problem arises if the planner asynchronously changes the schedule, e.g. deleting the task "watcher" users consider to be the next one, or inserting a closer one. How would watchers know, without a cyclic check on MySQL schedule table about task validity? I would need a sort of asynchronous server-pushing tecnhique towards watcher's browser when any schedule modification occurs. Would you say this could be done with PHP alone?
View Replies !
Apply The Preg_match To A Special Task Want To Perform A Regular Expression Match
well i want to apply the preg_match to a special task want to perform a regular expression match preg_matc - http://www.php.net/preg_match what does it do; int preg_match ( string pattern, string subject [, array &matches [, int flags [, int offset]]] ) Searches subject for a match to the regular expression given in pattern. If matches is provided, then it is filled with the results of search. $matches[0] will contain the text that matched the full pattern, $matches[1] will have the text that matched the first captured parenthesized subpattern, and so on. Code:
View Replies !
Looking For A Highly Modular Time Manager/task Manager System
I'm looking for a highly modular time manager/task mananger which is (of course!) written in PHP. Any suggestions? Btw. the system shall be open source developed under a GNU licence or such as we - a web developing tem - plans to fiddle with the code and integrate it in another to-come content management system...
View Replies !
In Background
Here's my situation. I'm creating a website (basically a store) and in the admin section users will want to download zip files of images or products added in the last 7 days, last 2 weeks and the last month. I have scripted a cron to run every 24 hours to zip all the images and this process takes over 1 minute (there's over 6,000 images!!) and the size of this is 250MB. This has now taken me to my quota on my webspace of 500MB (including all the individual images) I have decided the only way to do this is dynamically create the zip when the user requests it. As PHP times out after 30 seconds it needs to do it's stuff in the background and display a message saying something like' We'll email you with the zip file in 5 minutes or so'.
View Replies !
Run In The Background?
I have a script on my website that takes a long time to run, and it's slowing down my pages. Theres nothing I can do about the wait time on the file. Is there a way to use include or fopen or anything along those lines, to have it execute my file in the background; without having the file that's executing it waiting for it to finish its thing? Or to have the expected output redirected to another file (as mentioned in http://ca3.php.net/manual/en/function.exec.php)?
View Replies !
Running Background Job...
Is it possible to get a php3 script to check what day it is, and then do some stuff, If it’s let’s say Monday? This without you doing anything. Like a background - or cronjob… I guess you would use perl or something to do this, but that is not an option I have.
View Replies !
Background Processing
What is the technique you use for background processing? Like when user submit a task, the user could then wait for the result by email or through a result page. I'm wondering how would they do that?
View Replies !
Background Color
I am totally baffled by what is happening in my code. I have a section of code (shown below with two comment lines inserted). They are essentially identical text boxes (names and variables different). Yet, the first comes up with a white background and the second comes up with a yellow/gold background....
View Replies !
Run Process In Background
I want to run process from my php script in background. I try different functions from functions list but all of them whaiting for process ending. How can I run `wget -b ...` and finish my script, but wget must still working? I use PHP5, Linux, Apache2.
View Replies !
Background Processes
I'd like to know how to send an external process to the background, so that I can run multiple instances of the same process at one time. Any tips, links.. etc?
View Replies !
Running Php In The Background
I am trying to run a php executable (GTK) from a browser... now exec() does the job, but the browser hangs waiting for the .exe I have just called to finish, I assume so it can 'report back' to exec(), any ideas how I can get around this ? - I have tried backticks,passthru,system,exec - all with the same results, i.e. they all expect a returned value and sit around waiting for it. This is a windows app so /dev/null wont help & it is not a CGI with output I can dump anyway.
View Replies !
Run A Php In The Background Using Http
i have a script (script1) which needs to call another script (script2). It should not wait for the answer, so script2 should run in the background. I really need to call the php script using: http://urlof myscript/script2.php I don't want to use it as a cgi and use CLI. I did a test with fsockopen and curl and a timeout of 10 seconds and call http://urlof myscript/script1.php from my browser: Script1 stops after 10 seconds => OK Script2 has been called by script1 and continue to run in the background =>OK After 60 seconds Script2 is killed by php!! => KO :( The script is working fine if i call http://urlof myscript/script2.php from my browser. It needs around 120 seconds to finish. Why is it stopping after 60 seconds when I use fsockopen and call it from script1? Here is the script in SCRIPT1: $fp = fsockopen("$host", 80, $errno, $errstr, 30); stream_set_timeout($fp,10); if (!$fp) { echo "$errstr ($errno)<br /> "; } else { $out = "GET $path HTTP/1.1 "; $out .= "Host: $host "; $out .= "Connection: Close "; fwrite($fp, $out); $status = socket_get_status($fp); while (!feof($fp) && !$status['timed_out']) { echo fgets($fp, 128); $status = socket_get_status($fp); } fclose($fp); } I have added this in SCRIPT2: ignore_user_abort(FALSE); // becareful, FALSE really means it should ignore user abort !!! set_time_limit (120); ini_set("max_input_time",120); ini_set("max_execution_time",120); Do you have any idea?
View Replies !
Background Refresh
I am using php_move_file to upload some files to the server. I want to be able to support large files. But the Apache settings is that after 90 sec. the connections resets. This becomes a problem with large files (slow links). Is there anyway to write a script that would refresh in the background....
View Replies !
A Way To Get Current Background?
I have several websites running on a global script. Some pages, the backgrounds black, other, white. Sometimes people have the taste of posting black font on a black background, or white font on a white background. What I wanted is to know if theres a way to 'check' the current background color? Because I can then add in the script to 'change' any incorrect colors before posting. I'm not sure if theres a way for PHP to tap into CSS and check, but it would be alot easier to change the global script since its *Checking* for the background color rather then me do it per site and change it manually.
View Replies !
Background Redirection
I need to create a redirection from a php page to another, without having a web browser opened. Imagine that you make a php starting via command line or cron job, then your php is running in background and no web browser is open on it. How can this php (from the background, with no web browser opened) call (trigger) another php? please note that I'm not talking about include. I need that the background php gives control to ANOTHER php url . per what I tested the php 'header' command does not work and obviously also any javascript redirection cannot work because there is no web browser opened. so, finally, how can that php running in background call another php url?
View Replies !
Using SWF Files As Background
Im not sure if it posilbe, but im trying to get a SWF file as the background of my page, but the swf file is dynamically named. Its like a gallery and when a user clicks on the lick to that file, it displays the image /swf. but i want the file to appear as the background. code: echo "<body background = '".$POST['file_name']."'>"; ii have 3 files so far. file1, 2, 3 .swf. and i can easily view each one as a seperate file, and they work once i embed them as images. is this my php code, or do i have to look at my browser to display the swf as BG..?
View Replies !
Background Running
I have a php script. It basically fetches data from MySql DB, processes it, and updates the results back in the Database. There are some 18k rows in the DB. The processing involves querying some remote servers. What is the MOST efficient method to run the script in background ?
View Replies !
Random Background In PHP
Not sure if this can be done in PHP but I'm looking at giving users an option to choose a background image from a list ie when they click on a url it changes. If you click on the links to change of scene on the left hand column, you'll hopefully see what I mean. Can this be done in PHP? I've tried googling it, searching on various forums but can't seem to find anything..
View Replies !
Background Tasks
I'm using some weather rss feeds in a web site. The feeds are updated once every hour and cached in a local file. My problem is that every time the weather report is updating I get a long wait (not that long.. 2 or 3 secs) before the page is displayed. This happens becauses the teplate engine that parses the page is waiting for the weather section to be parsed and cached. Is there a ay I can start the weather parsing as a background thread and return immediatly to the template engine to continue to parse the page? And if so How?
View Replies !
Background Image
i created a calendar in php. i have this calendar displayed on another php page (index.php). i added a background image to the calendar. it displays fine on the calendar alone but it won't display as a background image when i display it on index.php.
View Replies !
Run PHP-Script In Background
I am using php 5.0.4 under IIS 6 under Windows Server 2003 and want to run a php-script as a separate process. This schript dies not have any output. I tried several variants without success: exec("c/php5/php.exe path/to/script parameters &") will run the schript but will wait until the schript finished processing. exec("c/php5/php.exe path/to/script parameters > null &") gives me the error message "The specified CGI application exceeded the allowed time for processing. The server has deleted the process." Dealing with other variants of php cli procesors like php-win.exe gave the same result. Also trying to use the start command did not help. My head is burned out, what else could run my script under this environment?
View Replies !
Transparent Background
i'll try to explain myself the best i can, here is the problem: i have a html page and inside this i want to put an iframe that contains a php page. That's ok, i can do it and it works, but the problem is that i can't make that php document to have transparent background. it turns white. Is it because of the iframe? the php document has transparent background, but when i see it inside the iframe it doesn't work.
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 !
Set Background Color
I am designing with flash and am sending variables on the end of a url to a php document which also contains a swf - I want to tell the php file what color to make the background in the html section I have:- <body bgcolor="<?php echo $bgcol">> I've tried moving the quote marks around but nothing seems to work - I also use php in the title and that is working fine - is it because it is inside a tag or something or do I have the wrong syntax?
View Replies !
Repeating My Background
i have a problem with repeating my background yet not haveing 2 images show. what is wrong in this code: <style type="text/css"> <!-- html { background-image: #FFFFFF url(http://www.runnerselite.com/images/linedown.jpg); background-repeat: repeat-y; background-position:0px 155px;} body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; } body { background-image: transparent url(http://www.runnerselite.com/images/line.jpg); background-repeat: repeat-y; background-position:15px 0px;
View Replies !
Execution In The Background
I want a php script to be executed in the background when the admin presses a button in an application which is running on a Linux environment. This page execution will take a long time(Maybe 16 hours). There I want the window in which the administrator presses the button to display logs of the background executing script after this script has been started. How do you go about acheiving this?
View Replies !
Background Process
I would like to create a script that acts like a background process. Basically once every hour, it will access a website, gather data from it, and write that data to a file on a remote server. The PHP code would be running on this same server. Is this type of non user activated, constantly running code possible?
View Replies !
Table Background
I know this is a php forum but since i hang out here more than anywhere else i was hopping you guys could help me out. i just started this site today but i am trying to get this background picture in the table on the right to keep from repeating: http://box1.no-ip.info/rpm like i said i just started today so its nothing impressive at all. also the entire content will be driven by a cms engine im working on so what you see in that link is just hard coded for now.
View Replies !
Background POST
how I can perform a background POST on a UNIX system using PHP. I don't know much about what a background POST actually is, so ANY information would be helpful. I'm trying to pass 5 variables to a particular URL and was told that a regular HTML Form POST wouldn't work, and that I had to use a background POST.
View Replies !
$_POST In Background
if it's possible to send post variables using php w/o changing the page (no i dont mean post to the same page). I have a site I want to post some variables to that returns xml which I parse and use in my script but i'm not sure if its possible to send the POST variables behind the scenes so it stays on my site.
View Replies !
Alternating Background
<?php $i=0; while ($i < $num) { $name=mysql_result($result,$i,"name"); $type=mysql_result($result,$i,"type"); $creator=mysql_result($result,$i,"creator"); $added=mysql_result($result,$i,"added"); $description=mysql_result($result,$i,"description"); $id=mysql_result($result,$i,"id"); ?> <tr> <td>2<font face="Arial, Helvetica, sans-serif"><? echo "$id"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$name"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$type"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$creator"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$added"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$description"; ?></font></td>
View Replies !
Starting Application In Background
On my main page I have several hyperlinks which point to a php page that plays different .wav files. In the play_sound.php page I just echo the .wav file and when the link is clicked in the calling page the browser (IE6) opens Winamp and plays the sound (since I output a header with Content-type: audio/wav). It works great but is there any way to open the application in the background or at least minimized so you don't see it over the top of the main page? Is it a setting in HTML that determines this or does it have to be done through php?
View Replies !
Background Colour Not Showing
I need to use a coloured background for a page which contains tables. Using Frontpage 2k I can create the background colour OK and it views correctly; but when viewed using apache, there is no background colour, it is just white.
View Replies !
Display Graphic As Background
I've just realised that my previous post was very confusing in usage of English. Therefore I am rephrasing it as following: How do I display a graphic file (e.g. archit01.jpg) as a background inside a HTML table. The graphic file is listed in a MYSQL table called gfx and the gfx_ID=archit01. hope it makes sense. :oops:
View Replies !
Exec In Background On Windows
How can I get an /exec'ed/ process to run in the background on an XP box? I have a monitor-like process which I am starting as 'exec("something.exe");' and, of course the exec function blocks until something.exe terminates. Just what I /don't/ want. (Wouldn't an & be nice here! Sigh) I need something.exe to disconnect and run in the background while I continue on with my script.
View Replies !
Sending Pings In The Background
I set up my CMS to open a small window that called up a script that sent pings in the background. I had also set up a script that sniffed out if the browser was blocking pop up windows for my CMS and asked the user to remove the block, but now, since I've changed comps, it seems that my damn anti virus is blocking it and won't let me change the settings! Is there any other way, maybe a temp cron, that I could run a script in the background and still allow the user to surf away?
View Replies !
Running A PHP Script In The Background
I'm currently working on a PHP script which is run from the bash prompt to perform various tasks. How can I get it to load itself into the background? (i.e. so the program runs, and continues to run "invisibly", but after executing the program you are returned to the bash prompt).
View Replies !
System Function To Run In Background
I have the following line of PHP code: $ret_val = system("PHP myscript.php $param1 $param2 >> output.txt &"); Obviously the intention is to run a PHP file in the background async'ly. This works 100% perfect on one server; running the script in the background without errors. On another server the above line runs the command immediately rather than in the background. Output is still redirected OK and no errors are reported. Does anyone know of a situation that might cause the above code wait for the child process to finish before continuing? The file was copied from one server to the other without any modifications. Furthor, both servers are identical in software. One was literally imaged from the other. The only difference might be the file permissions. I created some folders on both machines but I think on one of them I sudo'd to root to create a folder and on the other I was logged in as a user (so CHOWN might differ). In both cases though PHP has read/write access (no errors were reported and identical script output is produced). The permissions in question are those on the myscript.php and on the output.txt file produced. The PHP manual says nothing about file permissions affecting the ability for a target script to run in the background. Any thoughts? Should I be redirecting errout as well (e.g. 2>>errors.txt)? Maybe an error is being reported on the second server and that is why PHP is waiting? I can't see how PHP can know in advance that an error is going to happen before it starts running the script in the background though.
View Replies !
Background Text Image
How can I place text on a page like a watermark background. For example, I may want to put FOR SALE in large red letters in the center of a page at a 10% opacity then write text over it from the initial point of origin. I've tried using style commands, but the results are inconsistant.
View Replies !
A Tool To Generate Background
I am looking for a tool (script, plugin, code, ...) which can generate background image for webpage look at background on http://vtorrent.info/ page or on the Vista webpage. I want to create this in fly - only give two colours and expect result which will be created by function. Is any plugin for it? code in php or js or .. whatever ?
View Replies !
|