Vs: [PHP] PHP from command line

From: Date: Wed, 19 Jul 2000 22:48:39 +0000
Subject: Vs: [PHP] PHP from command line
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7348@lists.php.net to get a copy of this message
Hello! I try to explain my problem again and little bit clearer. :) Let's take an example: I have a normal Windows program, written with VB etc. This program should automaticly send a pre-formatted e-mail to given e-mail address. I have noticed that you have to make some things harder with VB than with PHP, one good example is sending e-mail to SMTP-server. So, I thought that why I couldn't pass those e-mail information to PHP parser and then PHP will send the e-mail. I don't want to install a web server software for this small action. So, I use the PHP.exe -parser program directly. I have made a normal PHP page for this operation. Then I just run a command "d:\php\php.exe d:\sendemail.php3" in shell. Now the PHP will run the PHP script I made and it should send the e-mail. But the problem is that how I can pass information to PHP when I'm running it as that way? I'm looking for the way how i.e. Apache server passes the QUERY_STRING -information to this PHP-parser? Does Apache save the QUERY_STRING -information to a file and passes then the file path to PHP or else??? If I knew the way how real web servers do this, I could simulate the same way with my VB program. Then there is another project I'm making. I have plans that I could make own web server soft for Windows on some day. That's why I want also some information how do web servers pass different variables (sent via form/query-string etc etc) to the PHP and any other CGI-parser? That's the problem. :) - Ville > I'm not sure I understand your question correctly, but using PHP from the > command line and using PHP on a web server are somewhat different setups. > Your PHP Windows list can help you set it up better than I, but the web > information is sent via a QUERY_STRING to your php page. PHP knows how to > handle this data and puts it all into variables for you, and you don't > really have to worry about it too much. You take it from there, writing a > script to do or output whatever you want. > > As for the command line, the inputting of information is a bit different. > You can create prompts for information to be typed in from stdin, you can > open files, you can access a database, you can use $argv, etc.

« previous php.general (#7348) next »