FUDforum - خوراک RDF
http://fudforum.org/forum/index.php
pathinfo problem
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=18120&th=3760#msg_18120
http://www.my_site.com/lc/browse.php/cat_id/1.html.
I do a str_replace to remove the ".html" and I end up with cat_id=1. My header page has <BASE HREF="http://www.my_site.com/lc/">
The pathinfo works fine on one host using php 4.3.4 but not on one using 4.2.3. Both run on unix. When I mouseover the link, it shows http://www.my_site.com/lc/browse.php/cat_id/1.html but I still get an 404 error .
pathinfo() came in with php 4.0.
Any ideas? ]]>esm20022004-05-10T06:42:34-00:00Re: pathinfo problem
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=18124&th=3760#msg_18124
]]>Ilia2004-05-10T12:53:10-00:00Re: pathinfo problem
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=18131&th=3760#msg_18131
any particular misconfiguration to look for? ]]>esm20022004-05-10T21:02:38-00:00Re: pathinfo problem
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=31412&th=3760#msg_31412
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.
]]>richardlynch2006-04-21T09:36:50-00:00