'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI' [message #23985] |
Thu, 07 April 2005 03:37 |
kenjb
Messages: 67 Registered: September 2004
Karma: 0
|
Member |
|
|
Hi there,
I was writing some php conditional statements regarding the url output for my website. Depending if the url matched particular query strings or not I would change an item or two on the page. In particular, if the forum was the current page, do not include the rdf_parser.php in the sidebar. Okay, everything seemed to work great and then I found three links on the forum that would cause the logic to break.
Those three links are:
- Today's Messages
- Unread Messages
- Unanswered messages
I’m sure I can probably figure out why those three links cause my simple logic to break, but I wound up using “>=” that fixed the problem for now. Originally I thought the strings should match exactly so I was using “==”. Off hand I think something along the lines of, maybe a space is added then removed at the end of the query string just prior to the page display or something along those lines. It is possible that php is doing what it always does and I’m just not aware of the intricacies or lack thereof, of the language. So many variables, so little time.
Can you (anyone) shed some light on this for me?
I’m not much of a programmer by any means so I’m kind of reluctant to post my hacked up code here for all to scrutinize. But, if you need to see it to possibly understand what might be different in those three links, I’ll post it.
Thanks
kenjb
|
|
|
Re: 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI' [message #24002 is a reply to message #23985] |
Thu, 07 April 2005 16:46 |
kenjb
Messages: 67 Registered: September 2004
Karma: 0
|
Member |
|
|
I just detect the query string in the url now and then ignore it and check for my forum path in the url for the logic. I ignore the query string part of the url output.
Something different about those three links though and the way the string output is made, or something. I took a quick look at it, at the moment I’m to lazy to see what the difference is.
kenjb
|
|
|