CodeIgniter Forums
Invalid URL display - 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: Invalid URL display (/thread-60966.html)



Invalid URL display - El Forum - 08-13-2014

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


Invalid URL display - El Forum - 08-13-2014

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


Invalid URL display - El Forum - 08-13-2014

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


Invalid URL display - El Forum - 08-13-2014

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