| | |
Execute PHP file in the background from html page
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2009
Posts: 9
Reputation:
Solved Threads: 0
Thank you ardav and robert_c_guy, I'll check what you suggest as soon as possible.
Is it possible by the way that the output of the php file gets stored in an external log file? (Either by appending new info about warnings, errors, normal output etc, or by replacing each time the existing log file with the new output? You see, this might be helpful sometimes.)
Thanks.
Is it possible by the way that the output of the php file gets stored in an external log file? (Either by appending new info about warnings, errors, normal output etc, or by replacing each time the existing log file with the new output? You see, this might be helpful sometimes.)
Thanks.
php Syntax (Toggle Plain Text)
$output = bla blah bla; /* the data output from the background php page. I had to put SOMETHING here, */ $getdate = date( 'd-m-Y, H:i:s' );// Get the date. $user_ip = $_SERVER['REMOTE_ADDR'];// Get the user IP, just in case. $referer = getenv("HTTP_REFERER");// Get the refering page. just in case $file = "./your path to logfile/logfile.csv"; /*define the file as required, csv opens easily in excell or imports to sql if REQ, but is really just a text file.*/ $fp = fopen($file, "a+"); //open the text file for writing. // Write into the text file. fputs ($fp, "$getdate, $user_ip, $referer, $output\n"); //see note after $output definition above fclose($fp);// Close the text file.
$output Last edited by almostbob; Jan 9th, 2009 at 11:15 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Please mark solved problems, solved
If at first you dont succeed, join the club
Please mark solved problems, solved
•
•
Join Date: Jul 2008
Posts: 147
Reputation:
Solved Threads: 25
Seems i am a bit late to the game, but your problem definitely lends itself to using AJAX.
and it would be a rather simple solution at that.
Although instead of recommending you learn AJAX from scratch, I'm going to point you to the prototype library http://www.prototypejs.org/ I'm sure you've probably heard of it.
Now,as far as working with prototype, I think the most all encompassing tutorial I have ever seen has to be this one http://www.phpriot.com/series/8-weeks-of-prototype
If you browse through those 8 lessons you'll have a pretty sound understanding of how it all works and comes together.
and it would be a rather simple solution at that.
Although instead of recommending you learn AJAX from scratch, I'm going to point you to the prototype library http://www.prototypejs.org/ I'm sure you've probably heard of it.
Now,as far as working with prototype, I think the most all encompassing tutorial I have ever seen has to be this one http://www.phpriot.com/series/8-weeks-of-prototype
If you browse through those 8 lessons you'll have a pretty sound understanding of how it all works and comes together.
![]() |
Similar Threads
- dynamic html (PHP)
- Creating an event or an action to a button. (PHP)
- problem in javascript coding in asp page (ASP)
- php adodb library connect remote mysql (PHP)
Other Threads in the PHP Forum
- Previous Thread: Getting the contents of a DIV on another page
- Next Thread: google chekout help
| Thread Tools | Search this Thread |
apache api array basic beginner broken cache cakephp class cms code computing confirm countingeverycharactersfromastring cron curl customizableitems database date delete dynamic echo email error fcc file filter folder form forms forum freelancing function functions gc_maxlifetime google header headmethod howtowriteathesis href htaccess html iframe image include incode ip javascript joomla limit link login malfunction match memmory memory menu method mod_rewrite multiple mysql navigation neutrality oop pagerank parsing paypal pdf php phpmysql query question random recursiveloop root script search select server sessions sms snippet soap source space sql support! system table template thesishelp trouble tutorial upload url variable video web window.onbeforeunload=closeme; youtube






