Re: help with include

From: Date: Tue, 08 Aug 2000 01:18:48 +0000
Subject: Re: help with include
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-10561@lists.php.net to get a copy of this message
On 7 Aug, Susan G. Long wrote: >> I'm really green with PHP but I thought I would see if someone >> can help me with this problem. I have this include statment that >> works if I put it on a temporary page: >> >> I have a >> script that I want to pull into a section of a page. If I put >> this statement >> on a blank page called temp.php3 it works fine: >> >> http://www.domain.com/temp.php3 >> >> <?php >> include >> ("http://www.domain.com/stuff/news.shtml"); >> ?> >> >> If I put this in my phpslash page under one of the blocks from >> the admin interface, it shows the code in the source instead of >> pulling the page in...help??? > > > --------------------------------- > Susan G. Long > Corporate Project Manager > sysadmin@up-link.net > --------------------------------- > Extra! Extra! Read All About it everyday at > http://www.up-link.net > If you are including a file from the local machine, you can get it via the local file system a lot faster than grabbing it via http. And as someone else has pointed out, what you get may not be the raw source after being passed through a server. Next, if there is php code in the file you are including and you want to parse it, you need to have <?php and ?> (or the short version, whatever you use) in the included file, notwithstanding that where you include it is in a php parsed block. Cheers -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#10561) next »