Forum Moderators: coopster & phranque

Message Too Old, No Replies

Any idea why this script will work on two servers but not a third?

Nor does it work on my localhost

         

Ranger

7:29 pm on Aug 5, 2002 (gmt 0)

10+ Year Member



Hi folks:

I've written the author, but not heard back; As I'm new to PHP, I'm going crazy trying to figure this out...

This nifty little "flexible navigation script" works on two servers, but it doesn't work correctly on the client server I need it to work on, nor does it work on my localhost. I've used the PhpInfo tag to compare the 4 setups, and nothing obvious jumps out at me.

My first thought was that Short Tags weren't enabled on the 2 servers that don't run this script properly - but they are.

The script can be found here:
the page template:
[onlinetools.org...]
the nav page:
[onlinetools.org...]

The script doesn't "error out", either, it simply doesn't
a) show the page name captured from the URI in the Title bar: In other words(=$d) just generates a blank spot in the Title.
b) it doesn't un-hyperlink the page you are on; all the pages remain hyperlinked.

One other question: you'd think that if it "didn't work" it would at least throw some kind of error (ColdFusion usually does) - is there some kind of advanced error-generation tag I can enable in the php.ini to help me debug this kind of problem?

Thanks kindly for your input.

ergophobe

8:54 pm on Aug 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What's the difference between the servers? Are the all Apache? If not, perhaps the problem is here?

4: $issite=explode("/",$REQUEST_URI);

What happens if you echo $REQUEST_URI? Is it defined on the page? In other words, are you starting with good data?

Tom

Ranger

7:12 pm on Aug 6, 2002 (gmt 0)

10+ Year Member



That's it! I'm not starting with any data at all: echoing $REQUEST_URI does NOT bring back anything on the servers that aren't running the script properly.

(BTW, all the servers are running Apache 1.3.26 'cept for my localhost, which is running Apache 2.0)

I'm not quite sure 'til I test this, but I think the problem might be because the original script was written with the PHP directive "register_globals" set on - which I just found out is defaulted to "off" in PHP 4.2 (and confirmed in my localhost php.ini). If this is the case, then I just have to figure out how to re-write the script around this...

ergophobe

11:38 pm on Aug 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



oooh I'm so proud of myself! If only I were as good at seeing that stuff when it's my own code!

Tom

Ranger

6:56 pm on Aug 12, 2002 (gmt 0)

10+ Year Member



That was a great call, Tom!

It turns out it WAS the Register Globals setting in PHP 4.2 - so all I had to do was replace

$REQUEST_URI

with

$_SERVER ['REQUEST_URI']

and it works like a charm!

Thanks again for setting me on the right path - now I'm going to write the original author and get him to upgrade his script online...