PHP 4.3.2 changes the include statement

GRRRR...... ......... This rant it brought to you in part by the letter "P" As you might have guessed, breakingwindows.com is my first attempt at a Movable Type site (and it shows). Well 210west.com is my second pass at Movable Type the site is a lot more efficient. I am using PHP include statements all over the place. I guess I could just as easily use SSI or MT includes, but I am using PHP includes, quite frankly cuz its less code to type. My host yesterday updated the server to the 4.3.2 build of PHP. It was out the end of May, but thats a different story. Anyway, now includes use the syntax of <?php @include("http://.... or you can use the server root like <?php include("/home/public_html/... and not have to use the @ sign. That @ sign is new. And I just happen to like using the absolute URL. So all of a sudden I get a lot of fun errors all over my page b/c I use includes a lot in my templates. But i am also using includes in all the posts of the 210west site. The byline is put in with an include. Yea, fun. At least they don't have a ton of posts yet. GRRRRR..... So why change something like the syntax of the include statement. Something so simple. I have seen other, larger changes to the PHP language made in the past. And at that point i said "why?" as well. It is just this time when It actually effects me and my meager level of understanding of the PHP language. Oh well. More work for the web monkey to do.

Comments (2)

Ken,

The @ sign is not part of the syntax of the include statement. Since include returns a warning if the file is not found, the @ sign will repress the warning. If you use require instead of include, then it will return a fatal error and stop the script. The problem you may be running into is how you are referring to the file to be included. php.net says that there are some problems that may occur if you use nested includeds and aren't carefull about it.

Later,
Brian

Thanks Brian :=D

I figured you woulld have an answer for me.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Warning: include(/home/meancode/public_html/breakingwindows/footer.php): failed to open stream: Permission denied in /home/breaking/public_html/2003/07/php_432_changes_the_include_st.php on line 231

Warning: include(): Failed opening '/home/meancode/public_html/breakingwindows/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/breaking/public_html/2003/07/php_432_changes_the_include_st.php on line 231

Blogcritics Magazine

Social Networking

Mac Headlines

Read up-to-date headlines on everything Mac.

Content provided by prMac.

ESRB Search

Creative Commons License
This weblog is licensed under a Creative Commons License.
Enhanced with Snapshots