Welcome Guest, Not a member yet? Register   Sign In
displaying uploaded pictures
#1

[eluser]$ilovephp[/eluser]
Hello fellow CI lovers!

I know this question is going to be "noob". Well, I really had a problem with displaying my uploaded pictures in my site.

I provided a form that will allow user to upload picture in the site. Fortunately, it did work and saving the uploaded files at the "./photos/user_name_of_the_user/album_name/photo.jpg".

When I check the folder, the picture was truly uploaded. The problem is the viewing or displaying of this uploaded photo. I tried the img tag in which the src attribute is the same to the path plus the filename of the uploaded pic:
Code:
<img src = "&lt;?php echo $path.$filename; ?&gt;"></img>
//where $path = ./photos/user_name_of_the_user/album_name/
// and $filename = photo.jpg
Yet, it didn't work.. I tried the background property of a div tag with the url attribute the same to the src i provided in img tag. Still, didn't work.

Please help me guys. Thanks
#2

[eluser]Neeraj Kumar[/eluser]
i think you should try using absolute urls...
#3

[eluser]Zeeshan Rasool[/eluser]
Try this,
&lt;?=base_url()?&gt;photos/user_name_of_the_user/album_name/&lt;?=$filename?&gt;
#4

[eluser]$ilovephp[/eluser]
[quote author="Zeeshan Rasool" date="1272291985"]Try this,
&lt;?=base_url()?&gt;photos/user_name_of_the_user/album_name/&lt;?=$filename?&gt;[/quote]

thanks.., it did work




Theme © iAndrew 2016 - Forum software by © MyBB