I think my problem is same like this, there is no answer for my question on
php-gen.
Please give me more attention than Stig because I was used the -q option.
this give me no result
- php with -C option
- c:\php\php.exe -f gen.hp
- using function passthru() , popen().
So before you send me to begginer.com, please try it.
thanx
Otto
> ----- Original Message -----
> From: "Stig S. Bakken" <[EMAIL PROTECTED]>
> To: "otto" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, April 18, 2002 8:59 PM
> Subject: Re: [PHP-DEV] HTML generate from PHP code
>
>
> > On Thu, 2002-04-18 at 00:56, otto wrote:
> > > Hi I have some problem when I try to generate HTML file from PHP.
> > >
> > > I have a "gen.php" and inside
-------------------------------------------------------------------
<?
if (@$QUERY_STRING=="generate"){
// I try on Linux and Win also, so it's not the OP.
system("a.bat");
/* content of a.bat: */
// c:\php\php.exe -q <gen.php >index.htm
// /usr/local/sbin/php -q <gen.php >index.htm
/*another try */
system("/php/php.exe < ".$DOCUMENT_ROOT.$PATH_INFO."index.html ");
Header("Location:index.html");
exit;
}
echo '<a href="gen.php?generate">Generate</a>';
echo "hello world."
?>
----------------------------------------------------------------------------
---------
> > >
> > > when I run the "a.bat" from command line it's ok. I get index.html
with
> content "hello world."
> > > But when I try direct from PHP /in browser url "gen.php?generate" /
> calling
> > > system("a.bat") I get this in index.html:
> > > ------------------------------------
> > > X-Powered-By: PHP/4.1.1
> > > Content-type: text/html
> > > ------------------------------------
> > >
> > > any idea why is that, or workaround solution ?
> >
> > Add "-q" after "php.exe". And next time send questions like this to
> > [EMAIL PROTECTED] ;-)
> >
> > - Stig
> >
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
I think he have the same problem.....
----- Original Message -----
From: "Jos� Le�n Serna" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 24, 2002 5:24 PM
Subject: [PHP] Execute an external program
> Hello:
> I use a W2000+Apache+PHP 4.1.2, and I want to execute an external
> command from PHP script, the line is something like this:
>
> psftp.exe [EMAIL PROTECTED] -pw root -b bat.txt
>
> psftp is a secure ftp console program, and the bat.txt file contains all
the
> necessary commands to get a file from the server and quit the session.
>
> If I execute this line from a console, everything goes well, connects to
the
> server, gets the file and return to the console, but I'm trying to do the
> same from a PHP script in various ways, popen, ` `, exec...
>
> Always is the same, it seems it does nothing, and I'm sure the psftp.exe
and
> bat.txt files are in the same dir of the script. Also I have created a
> console program with Delphi to execute the command, but doesn't work.
>
> Any idea?
>
> Best Regards.
> ----------------------------------------------------
> QaDRAM Studio, RAD Development for the WEB
> http://studio.qadram.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php