Hey,
I have a script where you can ad a user + a user ID-photo, but the page to update the information + photo is driving me crazy, the info is no problem, but the photo...
This is the script of the update-page, normally it would overwrite the previous uploaded file(as sofie_nr is the number on a identity card (dutch)). But even if I check the $_FILES it says it's empty... I've been freaking on this script the last 5 hours, plz help...
grtz
<td height="20"><b>Afbeelding ID kaart:</b></td>
<td>
<input type="hidden" name="MAX_FILE_SIZE" value="50000">
<input name="upfile2" type="file" size="40">
</td>
</tr>
</table></p>
<p>
<input type="submit" name="Submit" value="Wijzig">
</p>
</form>
<?php
}
}
else {
if(!empty($_POST['upfile2']))
{
$succes= false ;
$uploaddir = "id_jpeg/";
$filename="".$_POST['sofie_nr'].".jpg";
if ((ereg(".jpg",$filename)) ){
$uploadfile = $uploaddir . $filename;
if (move_uploaded_file($_FILES['upfile2']['tmp_name'], $uploadfile))
{
chmod($uploadfile, 0644);
print("File upload is succesvol afgerond");
$succes = true ;
}else{
print("File upload is mislukt");
}
}else{
print ("alleen afbeeldingen zijn toegestaan");
}
} else { $succes = "true"; }
if ($succes == true){
$sql= "UPDATE personeel SET
voorletter = '".$_POST["voorletter"]."',
voornaam = '".$_POST["voornaam"]."',
achternaam = '".$_POST["achternaam"]."',
straat = '".$_POST["straat"]."',
postcode = '".$_POST["postcode"]."',
woonplaats = '".$_POST["woonplaats"]."',
tel = '".$_POST["tel"]."',
tel_zak = '".$_POST["tel_zak"]."',
sofie_nr= '".$_POST["sofie_nr"]."',
functie = '".$_POST["functie"]."',
datum_in = '".$_POST["datum_in"]."'
WHERE pers_id = '".$_POST["id"]."' ";
$result = mysql_query($sql) or die ("FOUT:" . mysql_error());