Re: preprocessing a php file within another.

From: Date: Sat, 28 Oct 2000 08:43:48 +0000
Subject: Re: preprocessing a php file within another.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22427@lists.php.net to get a copy of this message
On Fri, 27 Oct 2000, Deepak Chawla wrote: > > 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). You'll want to use: include ("02.php"); That will have the exact same effect as if 02.php was a part of 01.php -- all variables will be available. Note that when you include a file, PHP slips back into HTML mode, so you have to <?php before any php instructions. You might also want to look at require(). There are some subtle differences between it and include, but include should work fine for you. -- Michael

« previous php.general (#22427) next »