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 "http://127.0.0.1/h/www.intel.com"

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

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

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

thank u very much..it works........

Cool ,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.