473,396 Members | 1,893 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,396 software developers and data experts.

pasing part of an URL to commandline php

Hi All

I have an URL like this

http://system/web/htdocs/graphthis.p...ss&monitor=aaa
I would like to call now the command line php like this:

php graphthis.php '?csv=/tmp/data.cvs&dir=/web/htdocs/stress&monitor=aaa'

The question is can php translate this parameter string into the $_GET[]
aray somehow, so I don't have to rewrite the script ?

Thanks in advance
Heinz
Jul 17 '05 #1
1 1479
"Heinz" <lu*********@yahoo.com> wrote in message
news:<2m************@uni-berlin.de>...

I have an URL like this

http://system/web/htdocs/graphthis.p...ss&monitor=aaa

I would like to call now the command line php like this:

php graphthis.php '?csv=/tmp/data.cvs&dir=/web/htdocs/stress&monitor=aaa'

The question is can php translate this parameter string into the $_GET[]
aray somehow, so I don't have to rewrite the script ?


Most likely, you will have to add a few things to your script.
In the command-line mode, arguments are stored in the $argv
variable (also accessible via $_SERVER['argv']).

Note also that you can recognize the mode in which PHP is running
by calling the php_sapi_name() function.

Cheers,
NC
Jul 17 '05 #2

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

Similar topics

4
by: nick | last post by:
Hi all: In the winform i want to run commandline with return value(string), then display this string in winform textbox. anyone has idea about that? Thanks Nick
1
by: Rvo | last post by:
I'm writing an application that should work both as a GUI and a commandline program. When running from commandline I want to give all output to the commandline instead of showing it it an own...
5
by: jcrouse | last post by:
I have the following code: Dim MyStartupArguments() As String MyStartupArguments = System.Environment.GetCommandLineArgs UBound(MyStartupArguments) RomName =...
2
by: Christoph Borger | last post by:
Hello! I have wrote a windows service in vb.net. This service monitors the running processes with WMI and the Win32_Process class. Till last month all seems ok. But since the begin of september...
1
by: ritesh.noronha | last post by:
Hi Group, I have a question regarding the commandline options of msbuild. I am currently using msbuild to build projects using the existing solution files. These solution files have references...
0
by: axlq | last post by:
While trying to learn the ins and outs of the php CURL library, I decided to write a php script that posts a form on the Chicago Board of Options (CBOE) web site, which returns an ASCII text file. ...
3
by: balakrishnan.dinesh | last post by:
hi frndz, As we know that, we can pass command line agrument for C using "scanf" commands, So as same as that, Is there any way to pass those commandline arguments through php code to C and...
1
by: RSH | last post by:
Hi, I have a silly question... I have a Windows Form project (VB.Net) that was created in Visual Studio 2003. The project runs great. Now I have to add the ability to run the same...
1
by: edmondsnake | last post by:
Dear all, I would like to ask questions about my VB.net program. The executable file of the program is called "PSP.exe" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As...
2
by: andreas.huesgen | last post by:
Hello, I am writing a commandline tool in Python which is often feed with lots of commandline arguments. In practice, the commandline already reached a critical length which is to long for Windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.