CodeIgniter Forums

Full Version: Invalid URL display
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
My code
Code:
<?=$link;?>

It's show on localhost like this
https://www.facebook.com/someone

But It's show on external server (cPanel)
www.mysite.com/https://www.facebook.com/someone

Any suggestion?

El Forum

[eluser]Patroklo[/eluser]
How do you populate this variable? If you make a var_dump of it previously what it shows?

El Forum

[eluser]CroNiX[/eluser]
$link is your own variable that you created. There is no way for us to know without you showing more code, like how you created the variable.

El Forum

[eluser]InsiteFX[/eluser]
You can do something like below or use CodeIgniters anchor method.

Controller:
Code:
$data = array();

$data['link']      = 'https://www.facebook.com/someone';
$data['link_name'] = 'Click someone';

$this->load->view('your_view', $data);

html:
Code:
<a href="&lt;?php echo $link; ?&gt;">&lt;?php echo $link_name; ?&gt;</a>