Why host address generated by PHP?

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
Grizou
Forum Newbie
Posts: 1
Joined: Thu Aug 15, 2002 4:26 am

Why host address generated by PHP?

Post by Grizou »

Since I'm new to PHP/MySQL programming, this may be a stupid question... but I still need to find the answer since there are no books that can help me.

Do you know why, whenever a link to an outside website is created from inside PHP, it includes automaticaly the address of http://mydomainname.net/ (let's pretend it's my domain name) before?

For example, a user registers his website in my USERS's database (let's pretend it's http://userdomainname.net/) . When I create a PHP page that would create a hyperlink to that website, if I click on that hyperlink it will automatically generate this address: http://mydomainname.net/http://userdomainname.net/ (inserting my website's address before the user's website address)

Is there some kind of configuration that should be modified on the MySQL or PHP server?

Thank you for your help.

Grizou
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I don't think it's a configuration error, it's more likely to be something that's going a bit screwy in the code. Could you post the script that creates the link so we can help you a bit better.

Mac
MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

Sometimes if you don't include http:// on the front of a link the browser assumes it is a local link, for example if I link to http://www.msn.com from http://www.mysite.com the browser will load http://www.mysite.com/www.msn.com get it?
Post Reply