Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
in my editprofilepicture.php
I have:

<?php
if(isset($_POST['upload'])){
    var_dump($_FILES['userfile']);echo"<br/><br/>";
	if($member->ChangeProfilePicture($_FILES['userfile'],$sessionID)){
            	header("ViewProfile.php?id=$id");
	}
}

echo "
		<form enctype=\"multitype/form-data\" action='#' method='post'>
		<table>
				<tr><td><input name='userfile' type='file'  id='uploadFile'/>
			</tr>
			
			<tr><td><input type='submit' name='upload' value='Edit Profile pictures'/></td></tr>
		</table>
		</form>";
	

?>


The error i got:

Notice: Undefined index: userfile in C:\xampp\htdocs\Classes\EditProfilePicture.php on line 22
NULL
Notice: Undefined index: userfile in C:\xampp\htdocs\Classes\EditProfilePicture.php on line 23

Why is the user file not recognized?
Posted

1 solution

Change:
enctype=\"multitype/form-data\" 

to
enctype="multipart/form-data"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900