Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                    <fieldset>
<form name="contactform" method="post" action="index.php">
<table width="450px">
<tr>
 <td valign="top">
  <label for="first_name">Name *</label>
 </td>
 <td valign="top">
  <input class="basic-slide" type="text" name="first_name" maxlength="50" size="30" placeholder="Your Name">
 </td>
</tr>
<tr>
 <td valign="top">
  <label for="email">E-Mail *</label>
 </td>
 <td valign="top">
  <input class="basic-slide" type="text" name="email" maxlength="80" size="30" placeholder="Your E-mail">
 </td>
</tr>
<tr>
 <td valign="top">
  <label for="comments">Content *</label>
 </td>
 <td valign="top">
  <textarea  class="basic-slide" name="comments" maxlength="1000" cols="25" rows="6" width="215" height="300" placeholder="Content"></textarea>
 </td>
</tr>
<tr>
<td valign="top">
    <label for="submit">&nbsp;</label>
</td>
 <td colspan="2" valign="top">
  <input class="basic-slide" type="submit" value="Submit" width="215">
 </td>
</tr>
</table>
</form>
</fieldset>
              
            
!

CSS

              
                    @import url(//fonts.googleapis.com/earlyaccess/nanumgothic.css);
    @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);

    fieldset {
        background-color: #B2E3AF;
    }

    label {
        font-family: 'Nanum Gothic', sans-serif;
    }

    .basic-slide {
        display: inline-block;
        width: 215px;
        padding: 10px 0 10px 15px;
        font-family: "Open Sans", sans;
        font-weight: 400;
        color: #377D6A;
        background: #efefef;
        border: 0;
        border-radius: 3px;
    }
              
            
!

JS

              
                <?php
if(isset($_POST['email'])) {
 

    $email_to = "exmaple@e-mail.com";
    $email_subject = "Received from member!";
 
    function died($error) {

        echo "Errors for the form appear below.<br />";
        echo $error."<br /><br />";
        echo "Return to the previous page and recommend reprovisioning.<br />";
        die();
    }
 
    if(!isset($_POST['first_name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['comments'])) {
        died('Sorry. There seems to be a problem with the form submitted.<br />');       
    }
 
     
 
    $first_name = $_POST['first_name'];
    $email_from = $_POST['email'];
    $comments = $_POST['comments'];
 
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
 
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= '[ Error ] : The email address you entered appears to be invalid.';
  }
 
  $string_exp = "/^[A-Za-z]+$/";
 
  if(!preg_match($string_exp,$first_name)) {
    $error_message .= '[ Error ] : The name you entered is invalid.<br />';
  }
 
  if(strlen($comments) < 2) {
    $error_message .= '[ Error ] : It appears that the input you entered does not exist..<br />';
  }
 
  if(strlen($error_message) > 0) {
    died($error_message);
  }

 
     
    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    }
 
     
 
    $email_message .= "Name : ".clean_string($first_name)."\n";
    $email_message .= "E-mail : ".clean_string($email_from)."\n";
    $email_message .= "Content : ".clean_string($comments)."\n";
 
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);  
?>

  Successfully transferred mail!

<?php
 
}
?>
  
  /* Rename index.js -> index.php */
              
            
!
999px

Console