Re: [PHP] getting commandline ?
You can check what options you have with executing php -h in a shell I believe this is PHP4 only tho. Anyway, i solved my little issue. #! /usr/bin/php -f If you run this from the commandline after chmod'ing it, and you specify parameters, for example the file is called 'test', you run it like : # ./test these are the parameters. output will be something like : The number of arguments including the executable : 5 = key 0 has value : ./test key 1 has value : these key 2 has value : are key 3 has value : the key 4 has value : parameters Nothing is stopping PHP from becoming a cool tool for about anything one can do with Perl, only much easier on some parts ;) Neatly written programs can even be used in cronjobs this way, like cleaning up a database on regular interval etc. That was my goal in the first place. Thank you both for getting me on track with this :)) -- - 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." "Lindsay Adams" <[EMAIL PROTECTED]> schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... | 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" <[EMAIL PROTECTED]> wrote: | | > $argv and $argc - also put #!/usr/local/bin/php -q at the top of your script | > (above the top | > --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: [EMAIL PROTECTED] | >> For additional commands, e-mail: [EMAIL PROTECTED] | >> To contact the list administrators, e-mail: [EMAIL PROTECTED] | > | > | > /*** ** | > *\ | > *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." * | > \*** ** | > */ | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | To contact the list administrators, e-mail: [EMAIL PROTECTED] | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] getting commandline ?
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Requesting username/pwd with apache and aqcuiring input
Wow, great !! Just what I was looking for ! 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." "Jaxon" <[EMAIL PROTECTED]> schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... | check this out: | http://www.zend.com/zend/tut/authentication.php | | regards, | jaxon | | | On 3/25/01 5:59 PM, "NoSpeed" <[EMAIL PROTECTED]> wrote: | | > Hi | > | > I wondered if it was possible in PHP to let it pop up a screen which | > reqcuires username/pwd from the visitor, just like you can tell apache to do | > so with the .htaccess files. | > | > And if yes, how to retrieve the input from the user ? | > | > -- | > - 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: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | To contact the list administrators, e-mail: [EMAIL PROTECTED] | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Requesting username/pwd with apache and aqcuiring input
Hi I wondered if it was possible in PHP to let it pop up a screen which reqcuires username/pwd from the visitor, just like you can tell apache to do so with the .htaccess files. And if yes, how to retrieve the input from the user ? -- - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP switch user ???
Hi there. Maybe this is a stupid question, i dunno, but untill now, nobody seemed to be able to answer it, so here goes. I have PHP4 running under apache as a DSO on a linux system. This is cool, it runs as nobody, and thus is fairly safe. But also very unfunctional when it comes to uploading files, manipulating and removing files :( Is there a way i can make PHP switch user for a while and then switch back ? I mean, like making it switch from nobody to the desired user, do stuff, when done, switch back to nobody ? I do not want to make folders/files world writeable etc. 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]