Me again (Huge Project...)
This is the code for my image upload, but it is not working...
I also want to set some parameters such as file size and to make sure that only photos are uploaded. The tutorials on the web is quite confusing...help please.
Thank you
if(isset($_POST['submitted']))
{
$add="C:/xampp/htdocs/oefen/images/profile/";
if(move_uploaded_file($userfile, $add))
$content= 'Success';
else
$content= "Upload failed";
}
else
{
$content=" <FORM ENCTYPE='multipart/form-data' ACTION='index.php?mod=photo' METHOD='POST'>
Upload this file: <INPUT NAME='userfile' TYPE='file' ID='file'/>
<input type='hidden' value='TRUE' name='submitted'/>
<INPUT TYPE='submit' VALUE='Upload Photo'></FORM>";
}
$p=new Page('Profile Photo');
$p->setHeading('Upload Profile Picture');
$p->setContent($content);
$p->printIt();
?>