something lot simpler than the usual crap I post about! Trying to create an 'Upload' button to allow user to upload pictures of themselves. The picture should then be renamed pid, and saved to the images folder..
I'm not sure why it isn't working, especially as firebug shows that fileField is being posted.
<?php
// Parse the form data and add inventory item to the system
if (isset($_POST['picID'])) {
$pid = $_SESSION["pid"];
// Place image in the folder
$newname = "$pid.jpg";
move_uploaded_file( $_FILES['fileField']['tmp_name'], "images/$newname");
header("location: index.php");
exit();
}
?>
Picture upload field
<form method='post' enctype='multipart/form-data' action='playerparent-profile.php?pid=<?=$pid?>'>
<td><label>
<input type="file" name="fileField" id="fileField" />
<input type="hidden" name="picID" id="picID" value="<?=$pid?>">
<input type="submit" name="button" id="button" value="UPLOAD" />
</label></td>
</form>
Just trying to figure out what the heck I'm doing wrong? Any help is appreciated!