PHP 18
Sendemail.php By Guest on 30th March 2017 03:03:26 AM
  1. if(isset($_POST['robots_prevention_hidden'])){
  2.        
  3.         $header  = "From: admin@somedomain.com\r\n";
  4.         $header .= "MIME-Version: 1.0\r\n";
  5.         $header .= "Content-Type: text/plain; charset=utf-8\r\n";
  6.         $header .= "X-Priority: 1\r\n";
  7.         $escaped_name=htmlspecialchars($_POST['name'], ENT_QUOTES, 'UTF-8');
  8.         $escaped_surname=htmlspecialchars($_POST['surname'], ENT_QUOTES, 'UTF-8');
  9.         $escaped_email=htmlspecialchars($_POST['email'], ENT_QUOTES, 'UTF-8');
  10.         $escaped_mobile =htmlspecialchars($_POST['mobile'], ENT_QUOTES, 'UTF-8');
  11.         $escaped_party_size=htmlspecialchars($_POST['party-size'], ENT_QUOTES, 'UTF-8');
  12.         $escaped_adults=htmlspecialchars($_POST['adults'], ENT_QUOTES, 'UTF-8');
  13.         $escaped_children=htmlspecialchars($_POST['children'], ENT_QUOTES, 'UTF-8');
  14.         $escaped_result=htmlspecialchars($_POST['get_result_price'], ENT_QUOTES, 'UTF-8');
  15.         $escaped_date=htmlspecialchars($_POST['datetimepickup'], ENT_QUOTES, 'UTF-8');
  16.         $escaped_time=htmlspecialchars($_POST['pickuptime'], ENT_QUOTES, 'UTF-8');
  17.         $escaped_comments=htmlspecialchars($_POST['comments'], ENT_QUOTES, 'UTF-8');
  18.         $escaped_subject=htmlspecialchars('Congrats ,some message' );
  19.         $msg = "tour1". "\r\n"
  20.                 .'Name : '  .$escaped_name. " " .$escaped_surname. "\r\n"
  21.                 .'Email :' .$escaped_email. "\r\n"
  22.                 .'Mobile: ' .$escaped_mobile. "\r\n"
  23.                 .'Adults :' .$escaped_adults. "\r\n"
  24.                 .'Children :' .$escaped_children. "\r\n"
  25.                 .'Price :' .$escaped_result. "\r\n"
  26.                 .'Date :' .$escaped_date. "\r\n"
  27.                 .'Time :'  .$escaped_time. "\r\n"
  28.                 .'Comments :' .$escaped_comments. "\r\n";
  29.                                
  30.                  mail($to, $escaped_subject, $msg, $headers);
  31.                  echo json_encode(array('status' => 'success'));
  32.                  
  33.            }   else {
  34.                  echo json_encode(array('status' => 'error'));
  35.                
  36.            }

Paste is for source code and general debugging text.

Login or Register to delete or keep track of your pastes.