FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » pathinfo problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: pathinfo problem [message #31412 is a reply to message #18131] Fri, 21 April 2006 09:36 Go to previous message
richardlynch is currently offline  richardlynch   United States
Messages: 8
Registered: April 2006
Karma:
Junior Member
Personally, I've always found the HTML BASE thing to be kinda flaky...

pathinfo() as a function may be "new" in PHP, but I'm pretty sure the data has always been there in $_SERVER.

You may want to compare the two, but that probably won't help -- But would if you needed it in older versions.

What the browser shows in the status bar on mouse-over, and what the browser decides to send you to not matching up sounds like a browser bug to me...

And it's probably caused by the BASE, not by PHP.

The first thing I would test would be to use full, complete, absolute URLs with everything from http:// all the way to .html in them.

That gives the browser no leeway to mess up.

PS I use pathinfo a TON as well, and would suggest you consider using:
/cat_id=1/category_name.html

This makes it MUCH easier to tear apart pathinfo() as you can explode on / and then on = to get your key/value pair -- plus you can add as many key/value pairs as you want and not worry about the position of them getting confusing.

You could even end up with something like:
/cat_id=1/product_id=5/subdir/category_name.html

And it's quite easy to detect the parts with no '=' and use those as a path to your internal data directory structure, while keeping the key=value parts easily.

I do this a lot.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: running both versions - php 4.3.0 and php 5 on one Apache-Server on Windows
Next Topic: Shopping Carts
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 12:23:59 GMT 2024

Total time taken to generate the page: 0.06891 seconds