preprocessing a php file within another.
| From: | Deepak Chawla | Date: | Sat, 28 Oct 2000 04:49:26 +0000 |
| Subject: | preprocessing a php file within another. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-22413@lists.php.net to get a copy of this message | ||
Hi folks,
I have a problem. I have a file (say 01.php) which has some variables set
from a posted form in html. I now need to process another file (say
02.php), which is a html file with php script embeded in it. The
processing should take place within 01.php. Not only that, the processing
of 02.php should be done with the environment of 01.php ( I need the form
variables in 02.php).
Can anyone please tell me how to do it. I am listing the methods I have
tried.
1. 01.php on preprocessing produces a html file which has javascript with
the statement window.location = "02.php".
[ unfortunately this won't work because 02.php isn't publicly accessable ]
2. using the system("php 02.php"); statement.
[ I don't know how I can transfer the environment variables ]
3. using the file (reads file into an array of strings), implode
(combines array of strings into a single string) and eval
(evaluates the php string in the current environment) functions.
[ unfortunately the eval function requires the whole string to be a php
script, but 02.php is essentially a html file with embeded php ]
Any suggestions to overcome the problems in any of the above methods, or a
new method that might work is welcome.
thanks
-deepak