I have a list of links in my db that I want to list.
These are links that users add to db, so I cannot know if they have written links with "http://".
Why is it so that links starting with "www." gets the whole path in front?
www.google.com in example under, wil be linked as localhost/mypage/www.google.com.
Of course I could do a check when user adds a link, and add "http://" if they don't, but for now I just want somebody to explain why this is so
Code: Select all
while($row = mysql_fetch_array($result))
{
echo '<a href="' . $row['link'] . '">' . $row['subject'] . '</a><br />';
}