I have this code:
Can you point out what's wrong? I'm uploading a file (.schematic) and it's not being uploaded.
PHP Code:
<form action="/index.php?page=site_add" method="post">
<table class="box">
<thead>
<tr>
<th colspan="2">Add Your Schematic</th>
</tr>
</thead>
<tbody>
<tr>
<td>Schematic Name:</td>
<td>
<input type="text" class="input" name="site_name" value="" />
<img src="/images/info.png" class="tooltip" title="The name of your schematic/build." />
</td>
</tr>
<tr>
<td>Your Schematic:</td>
<td>
<input name="site_url" type="file" />
<?php
$target = "schematics/";
$target = $target . basename( $_FILES['site_url']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['site_url']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['site_url']['name']). " has been uploaded";
}
?>
<img src="/images/info.png" class="tooltip" title="The Schematic of your uploading..." />
</td>
</tr>
<tr>
<td>Version:</td>
<td>
<input type="text" class="input" name="site_banner" value="" />
<img src="/images/info.png" class="tooltip" title="Include your schematic version." />
</td>
</tr>
<tr>
<td>Schematic Description:</td>
<td>
<textarea class="textarea" name="site_description"></textarea>
<img src="/images/info.png" class="tooltip" title="A detailed description of your schematic." />
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2"><input type="submit" name="submit" value="Upload Schematic" class="button" /></td>
</tr>
</tfoot>
</table>
</form>
Comment