?
Solved

system command with get variables

Posted on 2013-06-16
5
Medium Priority
?
334 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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

764 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