Re: getting commandline ?
| From: | Lindsay Adams | Date: | Sun, 08 Apr 2001 23:14:06 +0000 |
| Subject: | Re: getting commandline ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47676@lists.php.net to get a copy of this message | ||
Ooooh cool
Didn't even think about PHP invocation options like -q, probably because I
only work with mod_php at the moment.
That should help NoSpeed out.
On 4/8/01 4:00 PM, "Joe Stump" <miester@php.net> wrote:
> $argv and $argc - also put #!/usr/local/bin/php -q at the top of your script
> (above the top <?) and then chmod +x it to run it like a regular script.
>
> --Joe
>
> On Sun, Apr 08, 2001 at 11:13:34PM +0200, NoSpeed wrote:
>> Hi
>>
>> I want to write a small application that will change something in databases
>> on various locations.
>>
>> I can do this in Perl, but being used to the grace and simpleness of doing
>> DB's with PHP, DB's with Perl became a real super drag :((((
>>
>> So what i would like to know is the following.
>>
>> I know you can make a php executable and let it function as a script.
>> (by adding the correct shebang)
>>
>> But how can i make commandline parameters visible in the php script ?
>>
>> lets say we have this :
>>
>> $
>> /usr/bin/changeinfo.php -database=test -table=testtable -row=changethis -dat
>> a=replaceforthis.
>>
>> How can i get these parameters in the script so i can work with them ?
>>
>> Thanks
>>
>> --
>> - NoSpeed
>> ------------------------------------------------------
>> - Carpe Noctem
>>
>> "The stickers on the side of the box said "Supported Platforms: Windows 98,
>> Windows NT 4.0, Windows 2000 or better", so clearly Linux was a supported
>> platform."
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>> For additional commands, e-mail: php-general-help@lists.php.net
>> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
> /*****************************************************************************
> *\
> * Joe Stump - PHP/SQL/HTML Developer *
> * http://www.care2.com -
> http://www.miester.org -
> http://gtk.php-coder.net *
> * "Better to double your money on mediocrity than lose it all on a dream." *
> \*****************************************************************************
> */