"0000-00-00"){ $Birth_Date = $myrow["BirthDate"] ; } $Anniversary = $myrow["Anniv"] ; } } if($_REQUEST["theAction"] == "update"){ $dob = $_REQUEST[Birthdate] ; list($BirthMonth,$BirthDay,$BirthYear) = explode("/", $dob); $Birthdate = $BirthYear."-".$BirthMonth."-".$BirthDay ; $YearDiff = date("Y") - $BirthYear; $MonthDiff = date("m") - $BirthMonth; $DayDiff = date("d") - $BirthDay; if ($MonthDiff < "0"){ $YearDiff --; } else if ($BirthMonth == date("m") && $DayDiff < "0"){ $YearDiff --; } $age = $YearDiff ; $agelimit=$age; $ann = explode("/", $Anniversary) ; $Anniversary =$ann[2]."-".$ann[0]."-".$ann[1] ; $occupation = ereg_replace("'","´",$occupation); if(checkdate($BirthMonth,$BirthDay,$BirthYear)){ if($agelimit >= 18 && $agelimit <= 90){ $SQL2 = "UPDATE users SET Birth_Date ='$Birthdate' ,Occupation = '$occupation',Gender ='$gender' ,Marital_Status = '$Marital' ,Anniversary ='$Anniversary' WHERE ID = '" . $_SESSION["sessionUserID"]. "'"; $result1 = mysql_query($SQL2) or die(mysql_error()); $_SESSION["sessionGender"] = $gender; if( $_FILES['ProfilePicture']['name'] > " "){ //make sure this directory is writable! $path_thumbs = "userPhotos/"; //the new width of the resized image, in pixels. $img_thumb_width = 500; // $extlimit = "yes"; //Limit allowed extensions? (no for all extensions allowed) //List of allowed extensions if extlimit = yes $limitedext = array(".gif",".jpg",".png",".jpeg",".JPG"); //the image -> variables $file_type = $_FILES['ProfilePicture']['type']; $file_name = $_FILES['ProfilePicture']['name']; $file_size = $_FILES['ProfilePicture']['size']; $file_tmp = $_FILES['ProfilePicture']['tmp_name']; //check the file's extension $ext = strrchr($file_name,'.'); $ext = strtolower($ext); //uh-oh! the file extension is not allowed! if (($extlimit == "yes") && (!in_array($ext,$limitedext))) { echo "Wrong file extension.
--back"; exit(); } //so, whats the file's extension? $getExt = explode ('.', $file_name); $file_ext = $getExt[count($getExt)-1]; //create a random file name $rand_name = "profile_".$_SESSION['sessionUserID']."_".time(); //the new width variable $ThumbWidth = $img_thumb_width; //keep image type if($file_size){ if($file_type == "image/pjpeg" || $file_type == "image/jpeg"){ $new_img = imagecreatefromjpeg($file_tmp); }elseif($file_type == "image/x-png" || $file_type == "image/png"){ $new_img = imagecreatefrompng($file_tmp); }elseif($file_type == "image/gif"){ $new_img = imagecreatefromgif($file_tmp); } //list the width and height and keep the height ratio. list($width, $height) = getimagesize($file_tmp); //calculate the image ratio $imgratio=$width/$height; if ($imgratio>1){ $newwidth = $ThumbWidth; $newheight = $ThumbWidth/$imgratio; }else{ $newheight = $ThumbWidth; $newwidth = $ThumbWidth*$imgratio; } //make sure the image is big enough to resize if (($newwidth > $width) || ($newheight > $height) ){ $newwidth = $width; $newheight = $height; } //function for resize image. if (function_exists(imagecreatetruecolor)){ $resized_img = imagecreatetruecolor($newwidth,$newheight); }else{ die("Error: Please make sure you have GD library ver 2+"); } //the resizing is going on here! imagecopyresampled($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); //finally, save the image ImageJpeg ($resized_img,"$path_thumbs/$rand_name.$file_ext"); $pictureName= $rand_name.".".$file_ext ; ImageDestroy ($resized_img); ImageDestroy ($new_img); } //now do the thumb //make sure this directory is writable! $path_thumbs = "userPhotos/thumbnails/"; //the new width of the resized image, in pixels. $img_thumb_width = 84; // $extlimit = "yes"; //Limit allowed extensions? (no for all extensions allowed) //List of allowed extensions if extlimit = yes $limitedext = array(".gif",".jpg",".png",".jpeg",".JPG"); //the image -> variables $file_type = $_FILES['ProfilePicture']['type']; $file_name = $_FILES['ProfilePicture']['name']; $file_size = $_FILES['ProfilePicture']['size']; $file_tmp = $_FILES['ProfilePicture']['tmp_name']; //check the file's extension $ext = strrchr($file_name,'.'); $ext = strtolower($ext); //uh-oh! the file extension is not allowed! if (($extlimit == "yes") && (!in_array($ext,$limitedext))) { echo "Wrong file extension.
--back"; exit(); } //so, whats the file's extension? $getExt = explode ('.', $file_name); $file_ext = $getExt[count($getExt)-1]; //create a random file name // $rand_name = "profile-" . $_SESSION['sessionUserID'] ; //the new width variable $ThumbWidth = $img_thumb_width; ///////////////////////////////// // CREATE THE THUMBNAIL // //////////////////////////////// //keep image type if($file_size){ if($file_type == "image/pjpeg" || $file_type == "image/jpeg"){ $new_img = imagecreatefromjpeg($file_tmp); }elseif($file_type == "image/x-png" || $file_type == "image/png"){ $new_img = imagecreatefrompng($file_tmp); }elseif($file_type == "image/gif"){ $new_img = imagecreatefromgif($file_tmp); } //list the width and height and keep the height ratio. list($width, $height) = getimagesize($file_tmp); //calculate the image ratio $imgratio=$width/$height; if ($imgratio>1){ $newwidth = $ThumbWidth; $newheight = $ThumbWidth/$imgratio; }else{ $newheight = $ThumbWidth; $newwidth = $ThumbWidth*$imgratio; } //make sure the image is big enough to resize if (($newwidth > $width) || ($newheight > $height) ){ $newwidth = $width; $newheight = $height; } //function for resize image. if (function_exists(imagecreatetruecolor)){ $resized_img = imagecreatetruecolor($newwidth,$newheight); }else{ die("Error: Please make sure you have GD library ver 2+"); } //the resizing is going on here! imagecopyresampled($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); //finally, save the image ImageJpeg ($resized_img,"$path_thumbs/$rand_name.$file_ext"); // $pictureName= $rand_name.".".$file_ext ; ImageDestroy ($resized_img); ImageDestroy ($new_img); //now do tiny image //make sure this directory is writable! $path_thumbs = "userPhotos/tiny/"; //the new width of the resized image, in pixels. $img_thumb_width = 40; // $extlimit = "yes"; //Limit allowed extensions? (no for all extensions allowed) //List of allowed extensions if extlimit = yes $limitedext = array(".gif",".jpg",".png",".jpeg",".JPG"); //the image -> variables $file_type = $_FILES['ProfilePicture']['type']; $file_name = $_FILES['ProfilePicture']['name']; $file_size = $_FILES['ProfilePicture']['size']; $file_tmp = $_FILES['ProfilePicture']['tmp_name']; //check the file's extension $ext = strrchr($file_name,'.'); $ext = strtolower($ext); //uh-oh! the file extension is not allowed! if (($extlimit == "yes") && (!in_array($ext,$limitedext))) { echo "Wrong file extension.
--back"; exit(); } //so, whats the file's extension? $getExt = explode ('.', $file_name); $file_ext = $getExt[count($getExt)-1]; //create a random file name // $rand_name = "profile-" . $_SESSION['sessionUserID'] ; //the new width variable $ThumbWidth = $img_thumb_width; ///////////////////////////////// // CREATE THE THUMBNAIL // //////////////////////////////// //keep image type if($file_size){ if($file_type == "image/pjpeg" || $file_type == "image/jpeg"){ $new_img = imagecreatefromjpeg($file_tmp); }elseif($file_type == "image/x-png" || $file_type == "image/png"){ $new_img = imagecreatefrompng($file_tmp); }elseif($file_type == "image/gif"){ $new_img = imagecreatefromgif($file_tmp); } //list the width and height and keep the height ratio. list($width, $height) = getimagesize($file_tmp); //calculate the image ratio $imgratio=$width/$height; if ($imgratio>1){ $newwidth = $ThumbWidth; $newheight = $ThumbWidth/$imgratio; }else{ $newheight = $ThumbWidth; $newwidth = $ThumbWidth*$imgratio; } //make sure the image is big enough to resize if (($newwidth > $width) || ($newheight > $height) ){ $newwidth = $width; $newheight = $height; } //function for resize image. if (function_exists(imagecreatetruecolor)){ $resized_img = imagecreatetruecolor($newwidth,$newheight); }else{ die("Error: Please make sure you have GD library ver 2+"); } //the resizing is going on here! imagecopyresampled($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); //finally, save the image ImageJpeg ($resized_img,"$path_thumbs/$rand_name.$file_ext"); // $pictureName= $rand_name.".".$file_ext ; ImageDestroy ($resized_img); ImageDestroy ($new_img); } //end of tiny image } //GET FILE NAME TO DELETE $sql = "SELECT Photo FROM users WHERE ID = '" . $_SESSION["sessionUserID"]. "'"; $sth = mysql_query($sql) or die(mysql_error()); $myrow=mysql_fetch_array($sth); if ($myrow["Photo"]) { unlink("userPhotos/" . $myrow["Photo"]); unlink("userPhotos/thumbnails/" . $myrow["Photo"]); unlink("userPhotos/tiny/" . $myrow["Photo"]); } $SQL2 = "UPDATE users SET Photo ='$pictureName' WHERE ID = '" . $_SESSION["sessionUserID"]. "'"; $result1 = mysql_query($SQL2) or die(mysql_error()); } header("Location: myProfile.php"); exit ; } else { header("Location: editProfile1.php?error=a"); exit ; } } else { header("Location: editProfile1.php?error=d"); exit ; } } ?> YadaHome | Edit Profile
yada home
my fridge



2 Week Free Trial - Blockbuster Total Access

 

edit my profile

The birthdate provided is incorrect. Please enter a valid birthdate.
You must be at least 18 years of age to register with YadaHome.com.
My Profile  
); background-position:top; background-repeat:no-repeat">

Update Profile Photo:
(.gif , .jpg,.png or.jpeg)
Birthdate:
Invalid format. A value is required.
Why do we ask?
Gender: /> Male     /> Female
Marital Status: /> Single      /> Taken
Anniversary: Invalid format.
Occupation: "/>
 

 

 

 

colors