Jump to content

href with web link variable repeating my web site??


Recommended Posts

Hello Everyone,


I'm using PHP with MySQL.  One of the fields in the database is website.  The code I'm using is as follows:






html/php code:


<td><font face="Arial, Helvetica, sans-serif"><a href="<? echo "$web"; ?>">Website</a></font></td>


What it should do is have the clickable word Website with the correct url from the database.  Instead it's repeating the website the page is on.  For example it's doing this:




Any help is appreciated.



Link to comment
Share on other sites

Well I'll try to explain.

It more so that your link in the href is lacking the http://


lets say you use this as a self to server url, or a server path

<a href="./">link</a>
<a href="../">link</a>
<a href="/">link</a>


now lets point it to a place on your site, nothing is needed besides a file or script name

(this is the same way your domain names were treated)

<a href="my-script.php">link</a>
<a href="gallery/">link</a>


now when it sees a protocol such as http:// , ftp:// and so on, it knows to go outbound

<a href="http://somesite.com">link</a>

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.