Include()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
seeker2921
Forum Contributor
Posts: 120
Joined: Sat Mar 22, 2003 7:10 pm
Location: Wiesbaden Germany
Contact:

Include()

Post by seeker2921 »

Hello,

My Web host just recently upgraded to PHP 4.3.2 from 4.3.1 and I have a page called index.php and the only PHP cpde in this page was a few include() tags that I was using to call other PHP pages.. Well now that they upgraded when I call index.php it returns an error where the include stament is and I can't figuare out how to fix this.. any ideas?
User avatar
r337ard
Forum Commoner
Posts: 29
Joined: Tue Apr 15, 2003 6:14 am
Contact:

Post by r337ard »

try using a readfile() instead of include

AFAIK include() uses a specified path, but whenever include() doesn't work for me i use readfile().

sorry, not the best advice. but it works for me :)
seeker2921
Forum Contributor
Posts: 120
Joined: Sat Mar 22, 2003 7:10 pm
Location: Wiesbaden Germany
Contact:

Post by seeker2921 »

Sorry but I'm still a new to PHP and I haven't ever used readfile.. so the code for a simple redfile would be this correct?

<?php readfile('/path/to/file.php');>
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

What is the exact error message you were getting with the include?
seeker2921
Forum Contributor
Posts: 120
Joined: Sat Mar 22, 2003 7:10 pm
Location: Wiesbaden Germany
Contact:

Post by seeker2921 »

error function main() /path/to/index.php line190

Line 190 on index.php is

<?php include('/path/to/sile');>

it gives there error then it will show the contents of the file that was in the include script.. like for example I use an external file to show a quote each time the page is loaded and I use the php include method for this.. it will show the error bove then it will show the quote like its supposed to.. and when i switch it to SSI it works fine but I can't use shtml I need php..
Post Reply