Page 1 of 1

Include()

Posted: Fri Jun 20, 2003 6:16 pm
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?

Posted: Fri Jun 20, 2003 6:24 pm
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 :)

Posted: Fri Jun 20, 2003 6:28 pm
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');>

Posted: Fri Jun 20, 2003 9:41 pm
by nielsene
What is the exact error message you were getting with the include?

Posted: Fri Jun 20, 2003 10:49 pm
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..