Jump to content

[SOLVED] Error Reporting?


Solarpitch

Recommended Posts

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

Link to comment
Share on other sites

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);


}



Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.