CodeIgniter Forums
site_url not working on the server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: site_url not working on the server (/showthread.php?tid=57067)



site_url not working on the server - El Forum - 02-12-2013

[eluser]dinisptc[/eluser]
site_url not working on the server

Code:
<a href="&lt;?= site_url('user/profile') ?&gt;"><img src="&lt;?php echo base_url()." alt="profile"></a>

if i do it like this it works


Code:
<a href="&lt;?php echo site_url('user/profile') ?&gt;"><img src="&lt;?php echo base_url()."alt="profile"></a>

on the localhost it works and in another server

maybe the server should have something installed on the php


site_url not working on the server - El Forum - 02-12-2013

[eluser]Aken[/eluser]
Make sure PHP short tags are enabled on your server.


site_url not working on the server - El Forum - 02-12-2013

[eluser]CroNiX[/eluser]
Or enable it in the config, if you don't want to have to rely on the servers php settings.
Code:
$config['rewrite_short_tags'] = TRUE;



site_url not working on the server - El Forum - 02-12-2013

[eluser]p5systems[/eluser]
Hi,

Check your base_url in config.php

Code:
<a href="&lt;?php echo site_url('user/profile') ?&gt;"><img src="&lt;?php echo base_url(); ?&gt;"alt="profile"></a>

Thanks.


site_url not working on the server - El Forum - 02-12-2013

[eluser]Aken[/eluser]
[quote author="p5systems" date="1360730579"]Hi,

Check your base_url in config.php

Code:
<a href="&lt;?php echo site_url('user/profile') ?&gt;"><img src="&lt;?php echo base_url(); ?&gt;"alt="profile"></a>

Thanks.[/quote]
Unrelated and unhelpful.


site_url not working on the server - El Forum - 02-13-2013

[eluser]Aken[/eluser]
For crying out loud...


site_url not working on the server - El Forum - 02-13-2013

[eluser]rana[/eluser]
Its better not to use short tag at all.