scriptygoddess RSS Feed
 
 
 
 

Include lines count

Just ran into an interesting problem and wanted to post this here in case anyone else ever hits the same snag - hopefully I'll save you a headache.

I was recently helping someone out with cookies on their site. By all appearances - the cookie WAS being set (I made a "test" page that did nothing but call the cookie - and it worked fine), but when I tried to call it from their site, something wasn't working…

It turned out that they had a php include which looked like this:

<? include "<$MTBlogURL$>/includepage.php"; ?>

And while this basically worked - the page was included, and no specific errors were generated - it did cause a number of problems. One of the problems being that cookies weren't being called or recognized. But many other PHP things were working fine on the page.

Changing the includes to use the full server path fixed the problem. (By "full server path" I mean it kind of looked like: "/home/youraccount/public_html/myblog/includefile.php")

2 Responses to “Include lines count”

  1. 1
    Phil:

    WOW!!!! That's a great tip. Who would do something like that? *wink*

    Ok, fine it was me.

  2. 2
    Jennifer:

    LOL! Well - at least we learned something about includes! :D I'm actually very surprised by what it did - with it SORT OF working… usually it works or it doesn't (and spits errors out all over the place)… With it SORT OF working - it's really hard to pin point what the problem is…

Bookmarks

WordPress Resources

Meta