Re: Including a file with a custom function

From: Date: Wed, 29 Nov 2000 01:19:49 +0000
Subject: Re: Including a file with a custom function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27737@lists.php.net to get a copy of this message
On Wed, 29 Nov 2000, Tyler Longren wrote: > Hello, > > I've got the file named guestbook.inc. In this file, there is a function > named show_guestbook() to show a guestbook. In books.php, I do the > following: > > <? > include("config.inc"); > include("guestbook.inc"); > show_guestbook(); > ?> > > When I load the page books.php, the code inside guestbook.inc is displayed > on the screen. How do I get around this? > > Thanks, > Tyler Longren PHP drops back into HTML mode whenever it strikes an include or require - if you want anything in those files parsed by PHP you need to add PHP start/end tags in the appropriate place(s) in the included file. -- 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 (#27737) next »