Does the $PATH_INFO variable work on windows? I just get
404 errors if I add /whatever to the URL. Can anybody tell me why? Thanks.
| SitePoint Sponsor |



Does the $PATH_INFO variable work on windows? I just get
404 errors if I add /whatever to the URL. Can anybody tell me why? Thanks.
Love it? Hate it? Helpful? Useless?
Use the rate button to let me know what you think of my post!
$PATH_INFO works with Apache, which is a popular free web server.
On windows you're probably using IIS or PWS for your web server.
Now while apache (apache.org) is made for Linux/Unix, you can install it on windows, which is what you must do if you need to use the $PATH_INFO variable.
Chris Beasley - I publish content and ecommerce sites.
Featured Article: Free Comprehensive SEO Guide
My Guide to Building a Successful Website
My Blog|My Webmaster Forums



Thanks Aspen, but I am using apache.
Here is the code I have for test.php:
So if I go to localhost/test.php/555/867-3476?Name="Jen" then it should output this:PHP Code:<?PHP
$argv = split("/", $PATH_INFO);
while (list($key,$val) = each($argv) ) {
printf("%s : %s
", $key, $val);
}
printf("%s's phone number is (%s) %s.
",
$name, $argv[1], $argv[2]);
?>
But instead I get a 404 error not found.Jen's phone number is (555) 867-3476.
If I just go to test.php, I get the following output:
Can anybody tell me what's wrong? Do I need to change something in the php.ini file for this to work?0 : 's phone number is () .
Love it? Hate it? Helpful? Useless?
Use the rate button to let me know what you think of my post!



I think that it is in that last question mark, because then it looks for, essentially this:
c:\home\www\test.php\555\867-3476?Name=Jen
Because of your last question mark it looks for the dir test.php, 555, and 867-3476... see? If that dir were to exist and it contained an index.php file apache would call this page up: localhost/test.php/555/867-3476/?Name=Jen. Are you following me? When you use the search engine safe URLs then you need to use them ALL of the way through.
Try this instead:
See if that works for you.PHP Code:<?PHP
$argv = split("/", $PATH_INFO);
printf("%s's Phone Number Is (%s) %s", $argv[3], $argv[1], $argv[2]);
// OR
echo $argv[3] ."'s Phone Number Is (".$argv[1].")".$argv[2];
?>
Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.
Exbabylon- Professional Internet Services



I'll give it a try, thanks.
Love it? Hate it? Helpful? Useless?
Use the rate button to let me know what you think of my post!
I would also like to point out that at this time Google will not index url's that are in this manner
script.extension/variable/variable/variable
Chris Beasley - I publish content and ecommerce sites.
Featured Article: Free Comprehensive SEO Guide
My Guide to Building a Successful Website
My Blog|My Webmaster Forums



that's not a problem. I'm making an editing program in an admin section.
So it will be edit.php/main.php which will edit main.php
It still didn't work though. I use Xitami, so that might be why.
Love it? Hate it? Helpful? Useless?
Use the rate button to let me know what you think of my post!



Really? Google no longer accepts those types of URLS? Dang, and I just re-coded so all my stuff would work.![]()
Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.
Exbabylon- Professional Internet Services





It's too bad. Does anyone know how to make it work? Can you give an example that works?I would also like to point out that at this time Google will not index url's that are in this manner
Thanks,
John
If you're making an admin section why even bother? Afterall this method is only used to get search engines who don't index query strings to index your pages.
As for another way to do it, you can use a .htaccess error handling hack to do it.
There are a few articles on php builder on how to do it.
I also just switched my site to using this method because I got tired of waiting around for google to fix their spider and I Wasn't going to kiss all that traffic off.
Of course if you do use this method you can kiss your error logs goodbye as every page will be logged as an error by your server.
http://www.phpbuilder.com/columns/tim19990117.php3
Chris Beasley - I publish content and ecommerce sites.
Featured Article: Free Comprehensive SEO Guide
My Guide to Building a Successful Website
My Blog|My Webmaster Forums
Bookmarks