Solved

system command with get variables

Posted on 2013-06-16
5
323 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 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.

707 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