Executing a PHP file to write an html file
| From: | PHP User | Date: | Sat, 31 Mar 2001 17:36:53 +0000 |
| Subject: | Executing a PHP file to write an html file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-46450@lists.php.net to get a copy of this message | ||
Here is my problem.
I have a file, static.php
static.php writes to index.html by way of...
$filename = "/web/h16/docs/index.html";
$fp = fopen("$filename","w");
fwrite($fp, "<table width=\"230\">\n");
etc......
If I hit static.php from the command line, index.html gets written just fine. static.php does
it's job.
If I try to exec(), or system() static.php from a browser the browser just hangs. eg.
I add:
system ('/usr/local/bin/php web/h16/docs/index.html);
or
exec ('/usr/local/bin/php web/h16/docs/index.html);
To a file and get nothing. I tried with and without the absolute paths in the commands.
What I want to be able to do is every time I update a Db, at the same time I want the index page to
be rewritten to reflect the changes in the Db. And I don't want to have to go to the command
line everytime I want to rewrite the index page. So I would just hit "SAve" in the
update.php page, it would save to the Db, which it does now, and at the same time it hits static.php
and therefore rewrites index.html
I also tried header() but that was no good due to echo in the pages, gives that header already sent
error.
Is there a funtion I am missing somehwere that does the job?
It's a Unix box running php 4.03, and the Db is MySQL
Thanks Much!!
-
*****************************************************************
Sign up for these FREE offers and have the chance to win money and prizes!
Click Here http://winwith.chek.com/promotions.php3?partnerid=7"
*****************************************************************