Solarpitch Posted November 1, 2007 Share Posted November 1, 2007 Hey Guys, I think I may have done something that changed some setting on my server. My pages seem to be filled with a load of notices telling me about unused variables. I tried error_reporting( 0 ); at the top of the page, still no joy. Has anyone any idea? Notice: Undefined index: image2 in xxx on line 83 Notice: Undefined index: image3 in xxx on line 84 Notice: Undefined index: image4 in xxx on line 85 Notice: Undefined index: image5 in xxx on line 86 Notice: Undefined index: prop in xxx on line 87 ...etc Quote Link to comment https://forums.phpfreaks.com/topic/75680-solved-error-reporting/ Share on other sites More sharing options...
pocobueno1388 Posted November 1, 2007 Share Posted November 1, 2007 Post your code Quote Link to comment https://forums.phpfreaks.com/topic/75680-solved-error-reporting/#findComment-382955 Share on other sites More sharing options...
Solarpitch Posted November 1, 2007 Author Share Posted November 1, 2007 Hey, Here ya go... <?php session_start(); error_reporting(0); @include('../params/params.php'); @include_once('thumbnail.inc.php'); if(!isset($_SESSION['valid_admin'])) { header("Location:index.php"); } $process = ""; $process = isset($_POST['process']) ? $_POST['process'] : ''; if ($process != "execute") { //not being submitted... } else { $county=""; $location=""; $type=""; $county = $_POST['county']; $location = $_POST['location']; $type = $_POST['type']; if($error == 1){ //an error occured cant save... }else{ $imagedir = "images/"; //get time stamp and use it for filename so no two images will ever have the same name $timest = time(); $image1 = $_FILES['image1']['tmp_name']; //changed... if($image1 != ""){ $image1exists = 1; $includesimage = '1'; } //changed... if($image1exists == 1){ $image1file = $imagedir.$timest."AA".basename($_FILES['image1']['name']); } if($image1exists == 1){ $image1 = $imagedir.$timest."AA".basename($_FILES['image1']['name']); } if($image1exists == 1){ $image1a = $imagedir."THUMB".$timest."AA".basename($_FILES['image1']['name']); } if($_FILES['image1']['tmp_name'] != ""){ list($width, $height, $type, $attr) = getimagesize($_FILES['image1']['tmp_name']); move_uploaded_file($_FILES['image1']['tmp_name'], $image1file); if($width > $height){ $istaller = "0";} if($width < $height){ $istaller = "1";} if($width == $height){ $istaller = "2";} print_r($_FILES['image1']); print $image1file; $thumb = new Thumbnail($image1file); if($istaller == "0"){ $thumb->resize('0','100'); $thumb->cropFromCenter('100'); }elseif($istaller == "1"){ $thumb->resize('100','0'); $thumb->cropFromCenter('100'); }else{ $thumb->resize('100','100'); } $thumb->save($image1a,100); if($height > "650"){ $thumb2 = new Thumbnail($image1file); if($istaller == "0"){ $thumb2->resize('0','650'); $thumb2->cropFromCenter('650'); }elseif($istaller == "1"){ $thumb2->resize('650','0'); $thumb2->cropFromCenter('650'); }else{ $thumb2->resize('650','650'); } $thumb2->save($image1,100); } } insertproperty($county, $location, $type, $address, $price, $bedrooms, $sale_type, $description, $features, $accomodation, $image1, $image1a, $image2, $image3, $image4, $image5, $image6); } Quote Link to comment https://forums.phpfreaks.com/topic/75680-solved-error-reporting/#findComment-382961 Share on other sites More sharing options...
pocobueno1388 Posted November 1, 2007 Share Posted November 1, 2007 I never see you define any of these variables $image3, $image4, $image5, $image6 Where are you defining them? Quote Link to comment https://forums.phpfreaks.com/topic/75680-solved-error-reporting/#findComment-382970 Share on other sites More sharing options...
Solarpitch Posted November 1, 2007 Author Share Posted November 1, 2007 Umm.. I defined those variables now with... if($image1 != ""){ $image1exists = 1; $includesimage = '1'; } if($image2 != ""){ $image1exists = 1; $includesimage = '1'; } if($image3 != ""){ $image1exists = 1; $includesimage = '1'; } if($image4 != ""){ $image1exists = 1; $includesimage = '1'; } if($image5 != ""){ $image1exists = 1; $includesimage = '1'; } if($image6 != ""){ $image1exists = 1; $includesimage = '1'; } but I seem to be getting other error's for the other variables.. Notice: Undefined variable: image1exists in xxx Notice: Undefined variable: image2exists in xxx Notice: Undefined variable: image3exists in xxx Notice: Undefined variable: image4exists in xxx Notice: Undefined variable: image5exists in xxx Notice: Undefined variable: image6exists in xxx Quote Link to comment https://forums.phpfreaks.com/topic/75680-solved-error-reporting/#findComment-382975 Share on other sites More sharing options...
Solarpitch Posted November 1, 2007 Author Share Posted November 1, 2007 I answered my own question there! thanks man Quote Link to comment https://forums.phpfreaks.com/topic/75680-solved-error-reporting/#findComment-382982 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.