jd2007 Posted August 14, 2007 Share Posted August 14, 2007 i'm doing this: if (file_exists($_FILES['filef']['name'])) { if (filesize($_FILES['filef']['size'])>=3000000) { echo "Flash is good !"; } else { echo "Flash too large"; } } else { echo "Flash doesn't exist"; $error=error_get_last(); echo $error['message']; echo $error['line']; } Link to comment https://forums.phpfreaks.com/topic/64829-why-do-i-get-this-error-undefined-index-filef42/ Share on other sites More sharing options...
ToonMariner Posted August 14, 2007 Share Posted August 14, 2007 if (file_exists($_FILES['filef']['name'])) try using is_uploaded_file instead... which line are you getting the error on? Link to comment https://forums.phpfreaks.com/topic/64829-why-do-i-get-this-error-undefined-index-filef42/#findComment-323458 Share on other sites More sharing options...
jd2007 Posted August 14, 2007 Author Share Posted August 14, 2007 this is the full code: <?php class FlashUploader { private $host; private $username; private $password; private $db; private $table; private $title; private $brief; private $main; private $checkboxes; private $flash; private $thumb; private $author; private $submitted; private $score; private $size; function connectdb($l, $u, $p, $d) { $this->host=$l; $this->username=$u; $this->password=$p; $this->db=$d; mysql_connect($this->host, $this->username, $this->password); mysql_select_db($this->db); } function getandsendDetails($ftitle, $fbrief, $fmain, $fcbx, $aut, $subm, $sc) { $this->checkboxes=explode("/", $fcbx); $this->que="insert into videos (title, brief, main, author, submitted, size) values ($this->title, $this->brief, $this->main, $this->author, $this->submitted, $this->size)"; $this->res=mysql_query($this->que); } function checkFiles($file, $thumbnail) { //$this->flash=$file; //$this->thumb=$thumbnail; if (file_exists($_FILES['filef']['name'])) { if (filesize($_FILES['filef']['size'])>=3000000) { echo "Flash is good !"; } else { echo "Flash too large"; } } else { echo "Flash doesn't exist"; $error=error_get_last(); echo $error['message']; echo $error['line']; } } function moveFiles() { move_uploaded_file($_FILES["filef"]["tmp_name"], "a/"); } } $flashupload=new FlashUploader; $flashupload->connectdb("localhost", "root", "*****", "videoportal"); $x=$flashupload->checkFiles('', ''); if ($x=="Flash is good !") { $flashupload->moveFiles($_FILES["filef"], $_FILES["file2f"]); if (!$flashupload->moveFiles($_FILES["filef"], $_FILES["file2f"])) { echo "File could not be uploaded"; } else { $flashupload->getandsendDetails($_POST["textfield4"], $_POST["textfield5"], $_POST["textfield52"], $_GET["arr"], "jd2007", "2", "0"); } } else { echo $x; } ?> line 42 Link to comment https://forums.phpfreaks.com/topic/64829-why-do-i-get-this-error-undefined-index-filef42/#findComment-323470 Share on other sites More sharing options...
jd2007 Posted August 14, 2007 Author Share Posted August 14, 2007 i get the same error. Link to comment https://forums.phpfreaks.com/topic/64829-why-do-i-get-this-error-undefined-index-filef42/#findComment-323472 Share on other sites More sharing options...
ToonMariner Posted August 14, 2007 Share Posted August 14, 2007 and what line is the error reported on??? Link to comment https://forums.phpfreaks.com/topic/64829-why-do-i-get-this-error-undefined-index-filef42/#findComment-323477 Share on other sites More sharing options...
jd2007 Posted August 14, 2007 Author Share Posted August 14, 2007 42 Link to comment https://forums.phpfreaks.com/topic/64829-why-do-i-get-this-error-undefined-index-filef42/#findComment-323478 Share on other sites More sharing options...
jd2007 Posted August 14, 2007 Author Share Posted August 14, 2007 pls help me...what can be wrong ? Link to comment https://forums.phpfreaks.com/topic/64829-why-do-i-get-this-error-undefined-index-filef42/#findComment-323485 Share on other sites More sharing options...
ToonMariner Posted August 15, 2007 Share Posted August 15, 2007 may sound daft but is your <input type="image" got the name or id 'filef' ?? Link to comment https://forums.phpfreaks.com/topic/64829-why-do-i-get-this-error-undefined-index-filef42/#findComment-324195 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.