Re: HTML generate from PHP code
| From: | Stig S. Bakken | Date: | Thu, 18 Apr 2002 19:59:07 +0000 |
| Subject: | Re: HTML generate from PHP code | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-82981@lists.php.net to get a copy of this message | ||
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
> system("a.bat");
> // content of a.bat:
> // c:\php\php.exe -q <gen.php >index.htm
>
>
> //another try system("/php/php.exe < ".$DOCUMENT_ROOT.$PATH_INFO."
> >index.html ");
>
>
> // Header("Location:index.html");
> exit;
> }
>
>
> 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
php-general@lists.php.net ;-)
- Stig