i am designing a site...under xampp with php...now,i have a table called link where i want to link some special links by fething it from database...but my problem is when i open it ....it happens something like below...

suppose I give a url "www.intel.com" in the database by hyperlinking a text "link"

but when i click it... it open like ""

so,how i make it only "http://www.intel.com"

my echo code is echo "<td><center><a href=\"$url\">$link</center></td></a>";

9 Years
Discussion Span
Last Post by almostbob

Check the settings on your xampp installation. the root of the address is your loacal host

the link is opening in the current folder, your localhost, because you havent told it not to
www.intel.com is not a web link, without the protocol http:// it is a local link

Good solution store the full correct link in the database, as http://www.intel.com
many sites are not accessed at www
bad solution change the code echo "<td><center><a href=\"http://www.$url\">$link</center></td></a>"; bad because images.coogle.com ww2.ca.com and many other subdomainss that do not sit on www

roughly equivalent to not putting a drive specfier when on the local computer
z:\image.jpg will work
image.jpg fails

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.