Jump to content


Photo

include error


  • Please log in to reply
5 replies to this topic

#1 PC Nerd

PC Nerd
  • Members
  • PipPipPip
  • Advanced Member
  • 1,122 posts
  • LocationAustralia

Posted 06 July 2006 - 10:23 AM

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 help


thanks

PC Nerd

#2 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 06 July 2006 - 10:28 AM

You will need to show the code here.

Also, make sure the file to be included has been started and finished with php tags.

#3 PC Nerd

PC Nerd
  • Members
  • PipPipPip
  • Advanced Member
  • 1,122 posts
  • LocationAustralia

Posted 06 July 2006 - 10:30 AM

why does the file need to have php tags  isnt it inside other php tags once it is included???

ill post the code next


#4 PC Nerd

PC Nerd
  • Members
  • PipPipPip
  • Advanced Member
  • 1,122 posts
  • LocationAustralia

Posted 06 July 2006 - 10:32 AM

include("inc files/Database link.inc.php");


#5 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 06 July 2006 - 10:33 AM

http://uk.php.net/include/

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.



#6 PC Nerd

PC Nerd
  • Members
  • PipPipPip
  • Advanced Member
  • 1,122 posts
  • LocationAustralia

Posted 07 July 2006 - 01:03 AM

ok, thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users