Solved

system command with get variables

Posted on 2013-06-16
5
310 Views
Last Modified: 2013-07-04
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
0
Comment
Question by:Evan Cutler
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:Christopher Raymond Mendoza
ID: 39251586
Hello arcee123,

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

I hope it helps.

Regards,
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39251628
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.
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 39251948
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
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39252013
This page shows what to do: http://www.php.net/manual/en/features.commandline.usage.php  You probably ought to read the entire section on command line usage at least once.
0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 39300965
Thank you very much.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question