Unwanted forwrad slash in query string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
blackisotope
Forum Newbie
Posts: 2
Joined: Wed Sep 02, 2009 6:30 am

Unwanted forwrad slash in query string

Post by blackisotope »

Here's something that's really bugging me.
First, a basic URL link in php:

echo "<a href=\"http://www.googlecom\">Google</a>";

OK, that works fine.

Now, I try to extend the URL by adding a query string:

echo "<a href=\"http://www.google.com?id=1066\">Google</a>";

But the result is not what I expected. Even though the source code in the resulting page is correctly displayed as:

<a href="http://www.google.com?id=1066">Google</a>

The ACTUAL address which the browser tries to find is:

http://www.google.com/?id=1066

So where did that forward slash come from??? Any ideas?
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Unwanted forwrad slash in query string

Post by Mark Baker »

mod_dir on the google server?
blackisotope
Forum Newbie
Posts: 2
Joined: Wed Sep 02, 2009 6:30 am

Re: Unwanted forwrad slash in query string

Post by blackisotope »

The google url is purely used as an example. Substitute any url, hover over the link in your browser, and you'll see that a forward slash has been added to the url.
Post Reply