CodeIgniter Forums
how can i write a path in a view?? - 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: how can i write a path in a view?? (/thread-32416.html)



how can i write a path in a view?? - El Forum - 07-22-2010

[eluser]helle[/eluser]
in my controller i do this:

Code:
$this->data['imgpath'] = $_FILES['name']['name'];

and in my view this:

Code:
<div id="result">&lt;?=$imgpath?&gt;</div>

this leads to an no found error, which i can find in the error log.

How can i pass a path to my view??


how can i write a path in a view?? - El Forum - 07-22-2010

[eluser]helle[/eluser]
aaah set it into quotes and hurraay:

Code:
$this->data['imgpath'] = '"'.$_FILES['name']['name'].'"';