All pastes #508162 Raw Edit

Something

public text v1 · immutable
·published 2007-05-24 21:51 UTC
rendered paste body
<?php
  $fullname=$_POST["fullname"];
  $phone=$_POST["phone"];
  $email=$_POST["email"];
  $instant=$_POST["instant"];
  $subject=$_POST["subject"];
  $content=$_POST["content"];
  if((((!empty($fullname) || !empty($email)) || !empty($subject) || !empty($content)))) {
      if(strlen($fullname)>=3) {
          if(ctype_alpha($fullname)) {
              if(preg_match('#^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$#i',$email)) {
                  if(strlen($subject)>=6) {
                      if(strlen($content)>=30){
                          $new="Fullname: $fullname<br>Telephone: $phone<br>Email: $email<br>Instant: $instant<br>Subject: $subject<br>Content: $content";
                          mail("agentvoltage@gmail.com", "An email from your-website", $new); 
                      } else {
                          echo "Content is less then 30 characters";
                      }
                  } else {
                      echo "Subject is less then 6 characters";
                  } 
              } else {
                  echo "Email is not vaild";
              }
          } else {
              echo "Fullname cannot contain numbers";
              }
      } else {
          echo "Fullname is less then 3 characters";
      }
  } else {
      echo "Please check that none of the marked with wildcard fields isnt empty";
  }
?>