CodeIgniter Forums

Full Version: current url being added to links
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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?

El Forum

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

El Forum

[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