GremlinP1R Posted October 18, 2006 Share Posted October 18, 2006 Hi there all.I have done the file handeling tutorial of PHPFreaks but have a huge problem...As soon as I include() that class file for the file uploading, my script goes blank it just dissapear...And maybe if I can get that sorted I will be able to get the thing to work...Please Help me.... Don't know where to start looking....Thanx. Quote Link to comment https://forums.phpfreaks.com/topic/24302-include-problem/ Share on other sites More sharing options...
Daniel0 Posted October 18, 2006 Share Posted October 18, 2006 Try to put [code]error_reporting(E_ALL);[/code] on the top of your page and see if it returns any errors. Quote Link to comment https://forums.phpfreaks.com/topic/24302-include-problem/#findComment-110528 Share on other sites More sharing options...
GremlinP1R Posted October 18, 2006 Author Share Posted October 18, 2006 Help.... I used that code and it helped a lot thanx, quite a handy tool to have...Sorted all errors out on the class script but now have a new problem.... I'm getting this....[quote]Notice: Undefined index: upload in C:\wamp\www\P1R\memberspages\addmembers.php on line 339Notice: Undefined index: upload in C:\wamp\www\P1R\memberspages\addmembers.php on line 340[/quote]Okay now I think that my problem are here some where and it just don't feel and look right it just look if I'm shorting something....[code] // When Submitting if (isset($_POST['Submit'])){ include('uploadclass.php'); // Set upload info $upload_class = new Upload_Files; $upload_class -> temp_file_name = trim($_FILES['upload']['tmp_name']); // line 339 $upload_class -> file_name = trim(strtolower($_FILES['upload']['name'])); // line 340 $upload_class -> upload_dir = "images/cars/"; $upload_class -> upload_log_dir = "images/uploadlog/"; $upload_class -> max_file_size = 5000000; $upload_class -> banned_array = array(" "); $upload_class -> ext_array = array(" .jpg", " .gif", " .jpeg", " .png", " .bmp"); // Calling class Functions $valid_ext = $upload_class -> validate_extensions(); $valid_size = $upload_class -> validate_size(); $valid_user = $upload_class -> validate_user(); $max_size = $upload_class -> get_max_size(); $file_size = $upload_class -> get_file_size(); $upload_directory = $upload_class -> get_upload_dir(); $upload_log_directory = $upload_class -> get_upload_log_dir(); $upload_file = $upload_class -> upload_file_with_validation(); // Errors if (!$valid_ext){ $result = "file ext";} elseif (!$valid_size){ $result = "size";} elseif (!$valid_user){ $result = "user";} elseif ($file_exists){ $result = "exists";} else {$upload_file = $upload_class -> upload_file_with_validation(); if(!$upload_file){ $result = "Not Uploaded";} else{ $result = "Success";} } } [/code]Please help.... Thanx Quote Link to comment https://forums.phpfreaks.com/topic/24302-include-problem/#findComment-110819 Share on other sites More sharing options...
Destruction Posted October 18, 2006 Share Posted October 18, 2006 $_FILES['upload'] is the part it's talking of. An undefined index means the array index/key isn't defined anywhere. $_FILES['upload'] should be the name of the field in your form ie:<input type="file" name="upload"/>If you use a different name there, they need to match either way.HTHDest Quote Link to comment https://forums.phpfreaks.com/topic/24302-include-problem/#findComment-110830 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.