[eluser]Rodrigo Graça[/eluser]
Try this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title><?php echo $title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset-UTF-8">
<style type="text/css">
body {font-family: sans-serif;}
#form {width: 675px; margin: auto; border: 2px solid #000; padding: 10px;}
</style>
</head>
<body>
<div id="list_gallery">
<table name="list" id="list">
<thead>
<tr>
<th>
ID
</th>
<th>
file name
</th>
<th>
image
</th>
</tr>
</thead>
<tbody>
<?
if(count($records)>0 && $rows!="")
{
foreach($rows as $row)
{
?>
<tr id="<?=$row->id?>">
<td>
<span class="bosCheckbox tiptip">
<input type="checkbox" name="selection" value="1" />
<span class="box" title="Check"></span>
</span>
</td>
<td><?=$row->id?></td>
<td><?=$row->file_name?></td>
<td>
<img src="<?=base_url()?>assets/uploads/<?=$row->file_name?>" border="0" title="<?=$row->file_name?>" alt="<?=$row->file_name?>" width="75" height="75">
</td>
</tr>
<?
}
}
?>
</tbody>
</table>
</div>
<h1 align="center">Add News</h1>
<div id="form">
<?php
echo form_open_multipart('../admin/create');
echo "<label>Title:</label><br />";
echo form_input('title') . "<br /><br />";
echo "<label>Image:</label><br />";
echo form_upload('userfile') . "<br /><br />";
echo "<label>Content:</table><br />";
echo form_textarea('contents') . "<br /><br />";
echo form_submit('', 'Submit');
echo form_close();
?>
</div>
</body>
</html>
Notes:
Maybe some erros.... (HTML or PHP)
Where is "file_name" you should change to the name of your fiel in the database. (Or change the database field name to "file_name"
)
All my files are .jpg or .png (if you want to display another type you need to change "img" tag....)