kickoutbettman Posted July 30, 2009 Share Posted July 30, 2009 I'm trying to have a little upload/thumbnail script. But I get to this error (upload to the first directory seem to be working, but for some reason it doesn't get the fyle type) Notice: Use of undefined constant userfile - assumed 'userfile' in E:\Website\desrosiers-auto\test2.php on line 11 Notice: Use of undefined constant name - assumed 'name' in E:\Website\desrosiers-auto\test2.php on line 11 upload/test/large/10008_tapis_7.jpg Notice: Use of undefined constant userfile - assumed 'userfile' in E:\Website\desrosiers-auto\test2.php on line 13 Notice: Use of undefined constant tmp_name - assumed 'tmp_name' in E:\Website\desrosiers-auto\test2.php on line 13 Successfully uploaded the mage Notice: Use of undefined constant userfile - assumed 'userfile' in E:\Website\desrosiers-auto\test2.php on line 23 Notice: Use of undefined constant name - assumed 'name' in E:\Website\desrosiers-auto\test2.php on line 23 Notice: Use of undefined constant userfile - assumed 'userfile' in E:\Website\desrosiers-auto\test2.php on line 25 Notice: Use of undefined constant type - assumed 'type' in E:\Website\desrosiers-auto\test2.php on line 25 Notice: Use of undefined constant userfile - assumed 'userfile' in E:\Website\desrosiers-auto\test2.php on line 25 Notice: Use of undefined constant type - assumed 'type' in E:\Website\desrosiers-auto\test2.php on line 25 Your uploaded file must be of JPG or GIF. Other file types are not allowed #09-<?php #11-$add="upload/test/large/".$_FILES[userfile][name]; #12-if(move_uploaded_file ($_FILES[userfile][tmp_name],$add)){ #13-echo "Successfully uploaded the mage"; #14-chmod("$add",0777); #15- #16-}else{echo "Failed to upload file Contact Site admin to fix the problem"; #17-exit;} #18- #19-$n_width=100; // Fix the width of the thumb nail images #20-$n_height=100; // Fix the height of the thumb nail imaage #21- #22-$tsrc="upload/test/thumb/".$_FILES[userfile][name]; // Path where thumb nail image will be stored #23-//echo $tsrc; #24-if (!($_FILES[userfile][type] =="image/pjpeg" OR $_FILES[userfile][type]=="image/gif")){echo "Your #25-uploaded file must be of JPG or GIF. Other file types are not allowed<BR>"; #26-exit;} #27-?> Thank you for your help Link to comment https://forums.phpfreaks.com/topic/168148-solved-notice-use-of-undefined-constant-user-assumed/ Share on other sites More sharing options...
phpSensei Posted July 30, 2009 Share Posted July 30, 2009 USE QUOTATIONS! also to work your way around this in your php.ini set error_reporting to error_reporting = E_ALL & ~E_NOTICE Link to comment https://forums.phpfreaks.com/topic/168148-solved-notice-use-of-undefined-constant-user-assumed/#findComment-886834 Share on other sites More sharing options...
kickoutbettman Posted July 30, 2009 Author Share Posted July 30, 2009 Thank for your answer, But i'm not sure where should I use the quotation ? on the $_FILES var??? Link to comment https://forums.phpfreaks.com/topic/168148-solved-notice-use-of-undefined-constant-user-assumed/#findComment-886859 Share on other sites More sharing options...
phpSensei Posted July 30, 2009 Share Posted July 30, 2009 Thank for your answer, But i'm not sure where should I use the quotation ? on the $_FILES var??? yes Link to comment https://forums.phpfreaks.com/topic/168148-solved-notice-use-of-undefined-constant-user-assumed/#findComment-886861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.