On Thu, 16 Sep 2004 04:51, Andrew W wrote: > > On 13 Sep 2004, at 19:11, Ed Lazor wrote: > >> Why use SSI? PHP's include directive allows you to bring separate >> pages >> together for creating an overall page. You can include .html files. >> Also, >> PHP programming isn't *required* in a file with the php extension. > > I had wondered about that but I must be using it wrong because when I > include a section of code it doesn't include the source it includes the > output - if that makes sense. > > In other words suppose I had a file which contained the interfeace HTML > and took an argument like this file1.php?id=value > > now suppose the actual PHP code which took that id=value and did some > processing with it was in another file, file2.php, in order to get the > value to file2.php file1 would have to include the following: > > $id = $_REQUEST['id']; > include 'file1.php?id=$value'; > > In other words the arguments have to be passed accross twice. What am > I doing wrong?
Misunderstanding how include works? When you include file1.php, it is asthough you simply put the contents of file1.php in file2.php at the include point; file1.php is read from the filesystem. (Note that this is different if you include a file via an URL). So effectively you have $id = $_REQUEST['id']; include 'file1.php'; -->>all the code from file1.php is inserted here And in that code presumably is something that deals with $id, (which you have already defined in file2.php just before including file1.php) and is therefore available to the rest of the script. Cheers -- David Robley Obiwankenobiphobia: Fear of Jedi Masters -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php