Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Why is localhost added to all my links ?
- Hal Halloway
January 23, 2005, 4:34 am
rate this thread
have AMP on my system as a localhost. I use this to test PHP/MYSQL
scripts I write on my local PC.
I render a URL w/PHP by reading the URL string from a mysql field, eg.
on the php web page it shows as eg. www.yahoo.com link
But when I click the link I see that "localhost" is added to the URL
and it goes nowhere. ie. it get localhost added to the front -
Is there a setting somewhere so that the link is exactly what the link
is and localhost is not added.
Re: Why is localhost added to all my links ?
looks like PHP has a couple of rules:
1. if you prefix a URL with http:// or just a /, then it leaves it alone.
i.e "http://www.happyhappybunnies.com "
2. if you do neither of these, it prefixes them with a host name and /.
best choice would be to prefix full URLs with http:// and relative URLs
PHP does have a mechanism via which you can control what markup elements
it modifies on output, which somehow ties into the url_rewriter.tags entry
in the php.ini file. i haven't studied this too much, so i'm not 100%
certain how it works.
I am not an ANGRY man. Remove the rage from my email to reply.
- Janwillem Borleffs
January 23, 2005, 5:43 am