$max_height) { $width = ($max_height / $height) * $width; $height = $max_height; } # wider if ($width > $max_width) { $height = ($max_width / $width) * $height; $width = $max_width; } $image_p = imagecreatetruecolor($width, $height); imagecopyresampled($image_p, $img, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height); $pathToImages = 'uploads/testimonial-images/'; $fname = $max_width.'-'.$path; imagejpeg( $image_p, "{$pathToImages}{$fname}" ); } } //image upload starts if(isset($_POST['submit'])) { if(empty($_SESSION['letters_code'] ) || strcasecmp($_SESSION['letters_code'], $_POST['letters_code']) != 0) { $errors = "\n The Captcha Verification does not match!!!"; } if(empty($errors)) { //echo "insert into feedback set name='$name', mobile='$mobile', email='$email', message='$message', created_datetime='$Date' "; $ins_values =mysql_query("insert into feedback set name='$name', mobile='$mobile', email='$email', image='$up_path', message='$message', created_datetime='$Date' "); if($ins_values) { $msg="Thank you for your time and interest to providing us feedback!!!"; header('location:post-testimonial.php?msg='.$msg); } else { $msg="could not able to add try once again!!"; } } } //echo $messages ; ?> Sadhu Sobitharaj

Post a Testimonial !!


Upload Your Image :