herando Posted May 25, 2006 Share Posted May 25, 2006 hi all,i choose a image file from form field and upload. but the browser shows such errors:Notice: Undefined variable: uploadfile in c:\program files\apache group\apache\htdocs\u-r\upload.php on line 20Notice: Undefined variable: uploadfile in c:\program files\apache group\apache\htdocs\u-r\upload.php on line 23Warning: imagecopyresampled(): supplied argument is not a valid Image resource in c:\program files\apache group\apache\htdocs\u-r\upload.php on line 37Notice: Undefined index: uploadfile in c:\program files\apache group\apache\htdocs\u-r\upload.php on line 42Warning: imagedestroy(): supplied argument is not a valid Image resource in c:\program files\apache group\apache\htdocs\u-r\upload.php on line 45could anyone help me, please. here is the resizing code:<?php $uploadedfile = $_FILES['uploadfile']['tmp_name'];$src = imagecreatefromjpeg($uploadfile); list($width,$height)=getimagesize($uploadfile); $newwidth=260; $newheight=195; $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); $filename = "../images". $_FILES['uploadfile']['name']; imagedestroy($src); imagedestroy($tmp); ?> Quote Link to comment https://forums.phpfreaks.com/topic/10414-help-with-image-resizing/ Share on other sites More sharing options...
zq29 Posted May 25, 2006 Share Posted May 25, 2006 You're assigning your files temp name to a variable called $uploadedfile but calling the variable $uploadfile everywhere else. Quote Link to comment https://forums.phpfreaks.com/topic/10414-help-with-image-resizing/#findComment-38828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.