Title: PHP form help.
Last modified: August 20, 2016

---

# PHP form help.

 *  [danny_getextra](https://wordpress.org/support/users/danny_getextra/)
 * (@danny_getextra)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/php-form-help/)
 * Hi guys,
 * I’ve created a simple php form and am trying to get it to return empty fields
   to me for the email here’s what ive got.
 *     ```
       <?php
       if(isset($_POST))
   
       {
   
           $name = check_input($_POST['form2mail_name']);
           $email = check_input($_POST['form2mail_email'], "Enter an email address please");
           $telp = check_input($_POST['form2mail_tel']);
           $address = check_input($_POST['texform2mail_address']);
           $nature = check_input($_POST['form2mail_nature_of_interest']);
           $thickness = check_input($_POST['form2mail_thickness']);
           $projectName = check_input($_POST['form2mail_project_name']);
       	$sample = check_input($_POST['form2mail_samples']);
   
           //process sent message
           $to = 'danny@getextra.co.uk';
           $subject = 'Reqeust Info parapan.co.uk';
           $message = "Name : " . $name ."\n" ;
           $message .= "Address : " . $address ."\n" ;
           $message .= "Nature : " . $nature ."\n" ;
           $message .= "Thickness : " . $thickness ."\n" ;
           $message .= "Project Name : " . $projectName ."\n" ;
           $message .= "Sample : " . $sample ."\n" ;
           $header = "Form : " . $email; 
   
           $sentmail = mail($to, $subject, $message, $header);
       if($sentmail) {
       header('Location: http://79.170.44.86/parapan.co.uk/colours/index.html');
   
       }
   
       }
   
       ?>
       <? php
       function check_input($data, $problem='')
       {
           $data = trim($data);
           $data = stripslashes($data);
           $data = htmlspecialchars($data);
           if ($problem && strlen($data) == 0)
           {
               die($problem);
           }
           return $data;
       }
       ?>
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/php-form-help/#post-3103957)
 * Is this for a WordPress site?
 *  Thread Starter [danny_getextra](https://wordpress.org/support/users/danny_getextra/)
 * (@danny_getextra)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/php-form-help/#post-3103959)
 * Yes it is for my wordpress site
 *  Thread Starter [danny_getextra](https://wordpress.org/support/users/danny_getextra/)
 * (@danny_getextra)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/php-form-help/#post-3103960)
 * [http://79.170.44.86/parapan.co.uk/colours/index.html](http://79.170.44.86/parapan.co.uk/colours/index.html)
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/php-form-help/#post-3104105)
 * I’d suggest that you start looking at some contact form plugins – unless you 
   fancy building your own form plugin.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP form help.’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/php-form-help/#post-3104105)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
