Link to home
Start Free TrialLog in
Avatar of Evan Cutler
Evan CutlerFlag for United States of America

asked on

system command with get variables

I'm calling php pages using the system command.

I. E. System (mypage.php)

How do I send parameters like get or post?
 To save code. .. I'm going to call the same page multiple times and use the parameters to tell the script what I want.

.Thanks
Avatar of Christopher Raymond Mendoza
Christopher Raymond Mendoza

Hello arcee123,

Check this link: http://www.php.net/manual/en/features.commandline.php#108883

I hope it helps.

Regards,
Avatar of Dave Baldwin
GET and POST are 'methods' used in the HTTP protocol that is used to talk to web servers and are not available on the command line.  The article linked above shows how to convert parameters to command line parameters.  If the data is large, you should just save it to a file that the PHP program can read to get the information.
Avatar of Evan Cutler

ASKER

ok...
here's the problem.

I need a switch.

I have 23 php files I am calling from a cron.
it needs a "yes/no" parameter to dictacte whether or not to do something.

I have a master php file that calls the other three using the system() command.
I need to pass "yes" or "no" via some form of parameterization to perform my
command on the fly.

Any ideas?
Thanks.
Evan
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much.