Re: [PHP] Running a Shell Script in PHP HELP!

2001-09-30 Thread Armando Cerna

On Sunday 30 September 2001 04:31 pm, Matt Greer wrote:
> On Sunday 30 September 2001 18:23, Armando Cerna wrote:
> > I have tried system (updatemp) and exec (updatemp)
>
> The system() function requires a string as its argument. So you need to
> write it as system("updatemp"); or system("$files");
>
> Matt


Yeah I did it like that I just didn't type it out in the email like that, 
sorry for the confustion.  Would the contents of updatemp matter, just in 
case you didn't catch it on the previous email here it is



smbclient //machine/c -I 192.168.0.4 -U armando%secret -D a1 -c 'lcd /tmp/dbf 
; prompt ; mget *.dbf ; quit'

Thanks, 
Armando

-- 
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] Running a Shell Script in PHP HELP!

2001-09-30 Thread Matt Greer

On Sunday 30 September 2001 18:23, Armando Cerna wrote:

> I have tried system (updatemp) and exec (updatemp) 

The system() function requires a string as its argument. So you need to write 
it as system("updatemp"); or system("$files");

Matt

-- 
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] Running a Shell Script in PHP HELP!

2001-09-30 Thread Armando Cerna

On Sunday 30 September 2001 04:23 pm, Kath wrote:
> Executing the script could be good :)
>
> Try a system(); command.
>
> Alas, remember, PHP runs as whatever user apache does, so chances are it
> has no privledges to run any of these operations as it is
> www/nobody/apache/daemon/etc.
>
> You could sudo it in the system call.
>
> - k
>
> - Original Message -
> From: "Armando Cerna" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, September 30, 2001 7:14 PM
> Subject: [PHP] Running a Shell Script in PHP HELP!
>
> > I have a shell script that I am executing like this $files =
>
> `shellscript`;
>
> > but if I do an if ($files) it doesn't read $files as existing.  The
>
> contents
>
> > of the shell script is a smbclient line that copies a bunch of DBF files
>
> from
>
> > another machine.  Anyone have any idea?  Below is a little snipit of my
>
> code
>
> >  $files = `updatemp`;
> >
> >
> >   if ($files) {
> > print "$files";
> > print "I am god";
> >
> >   } else {
> > print "$files";
> > print "It's ok you'll get it working. =)";
> >   }
> >
> >
> >
> >
> >
> >
> > The contents of the updatemp file is as follows
> >
> > smbclient //machine/c -I 192.168.0.4 -U armando%secret -D a1 -c 'lcd
>
> /tmp/dbf
>
> > ; prompt ; mget *.dbf ; quit'
> >
> >
> > Thanks in advance,
> > Armando
> >
> > --
> > 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]


I have tried system (updatemp) and exec (updatemp) but the permissions and 
sudo thing did not occur to me could you show me an example of how this would 
be done im kindof new to all this.

TIA, 
Armando

-- 
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] Running a Shell Script in PHP HELP!

2001-09-30 Thread Kath

Executing the script could be good :)

Try a system(); command.

Alas, remember, PHP runs as whatever user apache does, so chances are it has
no privledges to run any of these operations as it is
www/nobody/apache/daemon/etc.

You could sudo it in the system call.

- k

- Original Message -
From: "Armando Cerna" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, September 30, 2001 7:14 PM
Subject: [PHP] Running a Shell Script in PHP HELP!


>
> I have a shell script that I am executing like this $files =
`shellscript`;
> but if I do an if ($files) it doesn't read $files as existing.  The
contents
> of the shell script is a smbclient line that copies a bunch of DBF files
from
> another machine.  Anyone have any idea?  Below is a little snipit of my
code
>
>  $files = `updatemp`;
>
>
>   if ($files) {
> print "$files";
> print "I am god";
>
>   } else {
> print "$files";
> print "It's ok you'll get it working. =)";
>   }
>
>
>
>
>
>
> The contents of the updatemp file is as follows
>
> smbclient //machine/c -I 192.168.0.4 -U armando%secret -D a1 -c 'lcd
/tmp/dbf
> ; prompt ; mget *.dbf ; quit'
>
>
> Thanks in advance,
> Armando
>
> --
> 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]