PC Nerd Posted July 6, 2006 Share Posted July 6, 2006 im trying to include a file, but when it does so, it echos the entire contents of the inc file. ive renamed the file .inc .php .inc.php but nothing works. can anyone helpthanksPC Nerd Link to comment https://forums.phpfreaks.com/topic/13832-include-error/ Share on other sites More sharing options...
GingerRobot Posted July 6, 2006 Share Posted July 6, 2006 You will need to show the code here.Also, make sure the file to be included has been started and finished with php tags. Link to comment https://forums.phpfreaks.com/topic/13832-include-error/#findComment-53784 Share on other sites More sharing options...
PC Nerd Posted July 6, 2006 Author Share Posted July 6, 2006 why does the file need to have php tags isnt it inside other php tags once it is included???ill post the code next Link to comment https://forums.phpfreaks.com/topic/13832-include-error/#findComment-53786 Share on other sites More sharing options...
PC Nerd Posted July 6, 2006 Author Share Posted July 6, 2006 [code]include("inc files/Database link.inc.php");[/code] Link to comment https://forums.phpfreaks.com/topic/13832-include-error/#findComment-53787 Share on other sites More sharing options...
GingerRobot Posted July 6, 2006 Share Posted July 6, 2006 http://uk.php.net/include/[quote]When a file is included, parsing drops out of PHP mode and into HTML mode at the beginning of the target file, and resumes again at the end. For this reason, any code inside the target file which should be executed as PHP code must be enclosed within valid PHP start and end tags.[/quote] Link to comment https://forums.phpfreaks.com/topic/13832-include-error/#findComment-53788 Share on other sites More sharing options...
PC Nerd Posted July 7, 2006 Author Share Posted July 7, 2006 ok, thanks Link to comment https://forums.phpfreaks.com/topic/13832-include-error/#findComment-54184 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.