pass arguments to a shell script
Posted: Fri Aug 20, 2004 8:51 am
Hi.
I need to execute a shell script and pass arguments to it. THe arguments are text collected in a php form and stored as variables.
So far I have done this:
I have tested the shellscript and it works fine if executed manually with args, but it is not working from the php script. Am I passing the argumants in the correct manner?
Thanks
I need to execute a shell script and pass arguments to it. THe arguments are text collected in a php form and stored as variables.
So far I have done this:
Code: Select all
<?php
include('header.php');
$user = $HTTP_POST_VARSї'user'];
$pw = $HTTP_POST_VARSї'pw'];
$pwcf = $HTTP_POST_VARSї'pwcf'];
if ($pw == $pwcf)
{
exec("./chpasswd.sh $user $pw $pwcf ");
}
else
{
echo("The passwords do not match, please try again");
}Thanks