PHP HEEEEEEEEEEEEELP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jim lowell
Forum Newbie
Posts: 1
Joined: Tue Feb 04, 2003 6:18 am
Contact:

PHP HEEEEEEEEEEEEELP

Post by jim lowell »

Hello You from PHP...
I have one question: I have to send the following commands to linux execute, like if i was at the command prompt:
NOVADATA=121422522003 <enter>
export NOVADATA <enter>
../cgi-bin/script.sh<enter>
So, i declared the string NOVADATA e exported, to be used ath "script.sh". I normally made it at the command prompt, beeing successful. But it is not working on PHP. I`m using a code like this:
exec("NOVADATA=121422522003");
exec("export NOVADATA");
exec("../cgi-bin/script.sh");

i`ve also tried with system(), in exec() `s place. and even placing it as a variable, like:
$a = exec("NOVADATA=121422522003");

Well, where am i mistaking? Please, could someone take me out of this???
Thanx in advance
PS: I have chmoded it and it is already with the needed permissions
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Hey Ripper,

The function you want is putenv. Check it out in the manual. It's good stuff. An example would be...

Code: Select all

putenv("GORGEOUS=KATE BUSH");
Cheers,
BDKR
Post Reply