Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

system command with get variables

Posted on 2013-06-16
5
Medium Priority
?
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 84

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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

618 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