CodeIgniter Forums
current url being added to links - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: current url being added to links (/thread-14021.html)



current url being added to links - El Forum - 12-15-2008

[eluser]bennyhill[/eluser]
In my source code (a product description from a database), I have a regular anchor tag

Code:
<a href="www.example.com">Example</a>

but when I mouse over the anchor in the browser I get the current url added to the beginning of the anchor such as

Code:
http://localhost/mysite/cat/106/www.example.com

As I stated above, it is a regular anchor tag that is in a product description coming from a database, I am not using the echo anchor() from the codeigniter library.

Does anyone know why this is happening?


current url being added to links - El Forum - 12-15-2008

[eluser]copernicus[/eluser]
Try <a href="http://www.example.com">Link</a>


current url being added to links - El Forum - 12-15-2008

[eluser]gstjohn[/eluser]
copernicus has got it right. If you don't have 'http://' the path is seen as a relative path rather than a URL