473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

CGI variables: /usr/local/bin/php test.php --x=hello --y=123

Hello

My question is the following:
I'm calling a PHP script as CGI over a shell a.e:
/usr/local/bin/php test.php --x=hello --y=123

How is it possible to access the variables x and y in the script.

is there a special array where these variables are stored?
I tried $_ENV and $_GET but it didn't work...
Thanks for your help

Yours sincerely
Marc Giombetti
Jul 17 '05 #1
1 2650
Marc Giombetti wrote:
Hello

My question is the following:
I'm calling a PHP script as CGI over a shell a.e:
/usr/local/bin/php test.php --x=hello --y=123

How is it possible to access the variables x and y in the script.

is there a special array where these variables are stored?
I tried $_ENV and $_GET but it didn't work...


argv/argc

http://ww.php.net/features.commandline

HTH

C.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
Hello I'm hoping someone can help me with the following. My son is learning PHP and wants to install an apache test server on our XP pro home computer so he can test his code before uploading...
2
by: len | last post by:
I am in a situation where I need to get a copy of test database that is on production server running MSSQL 2000 Standard to my local machine running MSSQL 2000 personel. I tried to use the copy...
2
by: BarrySearle | last post by:
# Is this valid (or is excp local to try/except)? try: try: doSomething1 excp = 0 except: excp = 1 #endTry if (_excp_): doSomething1 # is excp defined here? excp = 0
3
by: Joakim Hove | last post by:
Hello, i have a quite large and unwieldy function with *many* local variables. The various variables are typically only used in small parts of the function, and I would like to define them...
5
by: masood.iqbal | last post by:
My simplistic mind tells me that having local variables within looping constructs is a bad idea. The reason is that these variables are created during the beginning of an iteration and deleted at...
8
by: Howard Kaikow | last post by:
I got bored today, so I decided to rewrite the code in KB article 316383 to decrease the number of object references. This resulted in a number of nested With ... End With. The original code had...
8
by: Jim in Arizona | last post by:
I was trying to have an email sent when the page loads but having some trouble with it. Our server is an IIS 6.0 with Framework 2.0. It is set to windows authentication (not anonymous). I...
5
by: ljlevend2 | last post by:
Is there any way to create a local server during runtime? For example, if you add an existing Web Site to a Solution from within Visual Studio (by right clicking the solution in the Solution...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
87
by: CJ | last post by:
Hello: We know that C programs are often vulnerable to buffer overflows which overwrite the stack. But my question is: Why does C insist on storing local variables on the stack in the first...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.