Thursday 15 September 2011

command line - browser form must launch PHP script that disconnects and runs in background -


I have a PHP routine that runs properly with query / gate data from the browser, and I disconnect from it After launching the browser, it can be run in the background. It writes a file to disk and gives the link to the user, so it no longer requires a browser.

The IFrame path introduced by the browser looks like this

  src = "tool / scan.php? Type = all & order = latest and email = test @Extport "  

I will replace the IFRAME target with a middleman, which is all about the scan.php workhorse file.

I understand that exec () can be used, but apparently it is not fully understood that the command line and the resources I Have been found far away, being done by them.

I just tried to pass $ _SERVER ["DOCUMENT_ROOT"] path / filename $ _SERVER ['QUERY_STRING'] through verbatim, but that does not seem to work (in the quote below quote Value):

  exec ("/ var / www / vhosts / example com / httpdocs / tools / scan.php type = all & sequence = latest & amp; email =test@example.com ");   

Then I wonder if the command line is different from the browser parameter and tried it, but it is not

  exec (" / Var / www / vhosts /example.com/httpdocs/tool/scan.php Type = all command = latest email = test@example.com ");   

I need a tip in the right direction, if someone can provide an indicator to get rolling again, I am not very PHP literate and have not read me well , But I can usually face the most obstacles with some well-kept signals. Thanks ...

Your best bet might be to create an message line Is for Therefore, the script that accepts form posts submits data to data queue. The message line can be a table in a MySQL database, on which the data is processed. Then you have a cron service that is running every few minutes or that all messages will be queued out and processed.

If you want to run PHP in exec () function With the $$ _GET parameter you can:

  exec ( 'Php-cgi -f /var/www/vhosts/example.com/httpdocs/tool/scan Php Type = all orders = latest email = test@example.com');   

Or like this:

  exec ('wget') http://example.com/tool/scan.php?types=all& Order = latest & amp; Email = test@example.com "');    

No comments:

Post a Comment