Welcome Guest, Not a member yet? Register   Sign In
Display images from uploads folder using database
#2

[eluser]Rodrigo Graça[/eluser]
I have this code that can help you:

Code:
<?
$arrayData = explode(".", $row->file_name);

if( $arrayData[1]=="swf"){
    ?>
    <img src="&lt;?=base_url()?&gt;assets/images/swf.png" border="0" title="SWF" alt="SWF" width="75" height="75">
    &lt;?
}
else {
    ?&gt;
    <img src="&lt;?=base_url()?&gt;assets/uploads/&lt;?=$row-&gt;file_name?&gt;" border="0" title="&lt;?=$row-&gt;file_name?&gt;" alt="&lt;?=$row-&gt;file_name?&gt;" width="75" height="75">
    &lt;?
}
?&gt;

Forget the "if" part. I used the image html tag "img" to include the image that i received in "$row->file_name" from the database. The file name is for example "something.png"

And this is on the view file (yours is "panelview.php")


Messages In This Thread
Display images from uploads folder using database - by El Forum - 05-21-2012, 03:26 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 03:34 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 03:47 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 04:09 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 04:26 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 05:20 AM
Display images from uploads folder using database - by El Forum - 05-23-2012, 01:47 AM
Display images from uploads folder using database - by El Forum - 05-26-2012, 12:27 PM
Display images from uploads folder using database - by El Forum - 09-22-2012, 07:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB