G2A Many GEOs
SHARE
TWEET

Untitled

a guest May 19th, 2014 174 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.        
  2.  
  3.     SCRIPT
  4.     _________________________________________________________________________________________________________
  5.      
  6.     <?php
  7.             if(isset($_POST['name'])) {
  8.         $email_to = "MYEMAILADDRESS";
  9.         $email_subject = "iStudioFX Contact Form";
  10.              // validation expected data exists
  11.         if(!isset($_POST['name']) ||
  12.             !isset($_POST['subject']) ||
  13.             !isset($_POST['email']) ||
  14.             !isset($_POST['comments']) ) {
  15.             die();
  16.             }
  17.         $name = $_POST['name']; // required
  18.         $organisation = $_POST['subject']; // required
  19.         $email = $_POST['email']; // required
  20.         $comments = $_POST['comments']; // required
  21.      
  22.         $email_message = "iStudioFX Contact Form.\n\n";
  23.      
  24.         function clean_string($string) {
  25.           $bad = array("content-type","bcc:","to:","cc:","href");
  26.           return str_replace($bad,"",$string);
  27.         }
  28.      
  29.         $email_message .= "Name:    ".clean_string($name)."\n";
  30.         $email_message .= "subject: ".clean_string($organisation)."\n";
  31.         $email_message .= "Email:   ".clean_string($email)."\n";
  32.         $email_message .= "Comments:".clean_string($comments)."\n";
  33.      
  34.             // create email headers
  35.             $headers = 'From: iStudioFX.com' . "\r\n" .
  36.             'Reply-To: '.$email."\r\n" .
  37.             'X-Mailer: PHP/' . phpversion();
  38.             $ret = @mail($email_to, $email_subject, $email_message, $headers);
  39.             setcookie("seeMeOnce", $ret);
  40.     }
  41.     ?>
  42.      
  43.      
  44.     SHORTCODE
  45.     ______________________________________________________________________________________________________
  46.      
  47.     function istudiofx_shortcode_contact( $atts, $content = null ) {
  48.        extract( shortcode_atts( array(
  49.             'email' => get_bloginfo('admin_email')
  50.             ), $atts ) );
  51.      
  52.             $content .= '<form id="contactform" method="post" action="">';
  53.             $content .= '<ol class="forms">';
  54.             $content .= '<fieldset id="contactleft">';
  55.             $content .= '<br /><br />';
  56.                       $content .= '<cm><label for="name" class="cm">name:</label>
  57.                       <input id="name" name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]]"/><br /></cm>';
  58.                       $content .= '<cm><label for="subject" class="font">subject:</label>';
  59.                       $content .= '<input id="subject" name="subject" type="text"  class="validate[required,length[0,100]]"/>
  60.                       <br /></cm>';
  61.                       $content .= '<cm><label for="email" class="font">email:</label>';
  62.                       $content .= '<input id="email" name="email" type="text"  class="validate[required,length[0,100]]" /><br /></cm>
  63.             </fieldset>';
  64.             $content .= '<fieldset id="contactright">';
  65.                       $content .= '<cm class="textarea">';
  66.                       $content .= '<label for="comments" class="font">comments:</label>';
  67.                       $content .= '<textarea id="comments" name="comments" class="validate[required]"></textarea><br /><br />';
  68.                                     $content .= '<cm class="buttons">';
  69.                                     $content .= '<input type="hidden" name="submitted" id="submitted" value="true" />';
  70.                                     $content .= '<button type="submit">Submit &raquo;</button>';
  71.                                     $content .= '</ol>';
  72.                     $content .= '</fieldset>';
  73.                     $content .= '</form>';
  74.             return $content;
  75.     }
  76.     add_shortcode('contact', 'istudiofx_shortcode_contact');
  77.     ?>
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top