CodeIgniter Forums

Full Version: link for website
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]PHP Programmer[/eluser]
I am trying to add a link by using anchor() function.
I have a string say "Click Here" and I want to establish a link on it say
I am doing it like:
anchor("$search->url", "Click Here")

But I am conveyed to http://localhost/mySite/ because $search->url is assigned to in my DB

How can make a link to directly.

Please suggest

El Forum

add http:// to the stored url

El Forum

there's also a helper function called prep_url() that will add the http:// only if it's necessary (in cases where you won't know if it's there or not, i.e., user inputted urls).

Check the manual for the url helper.