questo form
<form action="imagem.php" method="post" enctype='multipart/form-data'>
<input type="file" id="foto" name="foto" />
<input type="submit" value="Enviar" />
invia i dati che servono per fare l'upload a imagem.php
si potrebbe trasformare questo html in php?