how to pass variables to script when using php from command line

From: Date: Mon, 30 Oct 2000 18:44:18 +0000
Subject: how to pass variables to script when using php from command line
Groups: php.general 
Request: Send a blank email to php-general+get-22724@lists.php.net to get a copy of this message
I need to write a web page that can mail to thousands of our users same kind of mail. I didn't think that doing this from apache module php was a good idea. So I compiled php to another directory as cgi. I can use it from command line now. So I will get a message from the web page to a regular .php page, which will then do st. like exec("php massmailscript.php"); and return. The cgi type php script will be still running though. Problem is: I don't know how to pass variables to the script. I suppose I should be able to do php massmailscript.php message="..........." But how to use arguments in massmailscript? Is there something like argc-argv? Also, the $message can be pretty long and can include newlines. So doing st like exec("php massmailscript.php message=$message", $results); may not be a good idea. Thanks. Oguz.

« previous php.general (#22724) next »