Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Siuntimas

Parašė ZW· 2010 Gru. 26 19:12:50
#2

Naudok php... Paieskok goole...

Turejau kontaktu forma kazkur... rasiu idesiu... ;)
Stai... jai kazka ismanai panaudosi... ;)

          <!-- contact form -->
            <div class="contact_form">
            <?php 
            if(isset($_POST['submitted'])) {
              if(trim($_POST['checking']) !== '') {
                $captchaError = true;
              } else {
                if(trim($_POST['contactName']) === '' OR trim($_POST['contactName']) === 'Name') {
                  $nameError = 'Enter your name.';
                  $hasError = true;
                } else {
                  $name = trim($_POST['contactName']);
                }
                if(trim($_POST['contactEmail']) === '')  {
                  $emailError = 'Enter your email address.';
                  $hasError = true;
                } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['contactEmail']))) {
                  $emailError = 'Enter valid email address.';
                  $hasError = true;
                } else {
                  $email = trim($_POST['contactEmail']);
                }
                if(trim($_POST['contactMessage']) === '') {
                  $messageError = 'Enter message.';
                  $hasError = true;
                } else {
                  $message = trim($_POST['contactMessage']);
                }
                if(!isset($hasError)) {
									$youremail = "email@yourdomain.com"; // Enter your email address
									$emailsubject = "Contact Inquiry"; // Enter your email subject
                  $body = "Your received a contact inquiry\n--------------------------------------\nName: $name \nEmail: $email \nMessage: $message \n--------------------------------------\n";
                  $headers = 'From: '.$name.' <'.$email.'>' . "\r\n" . 'Reply-To: '.$name.' <'. $email.'>';
                  mail($youremail, $emailsubject, $body, $headers);
                  $emailSent = true;
                }
              }
            }
            ?>
            <?php if(isset($emailSent) && $emailSent == true) { ?>
              <div class="thanks">
                <h1>Thanks</h1>
                <p>I received your message.<br />I will get back to you asap.</p>
              </div>
            <?php } else { ?>
              <?php if(isset($hasError)) { ?>
                <p class="error">There was an error submitting the form.<br />Please try again.<p>
              <?php } ?>
              <form action="index.php" id="contactForm" method="post">
                <ul>
                  <li><label for="contactName">Name</label><input name="contactName" id="contactName" value="<?php if(isset($_POST['contactName'])) { echo $_POST['contactName'];} else { echo "Name"; } ?>" class="input_item requiredField" type="text" onclick="if(this.value=='Name')this.value='';" onblur="if(this.value=='')this.value='Name';" /></li>
                  <li><label for="contactEmail">Email</label><input name="contactEmail" id="contactEmail" value="<?php if(isset($_POST['contactEmail'])) { echo $_POST['contactEmail'];} else { echo "Email"; } ?>" class="input_item requiredField email" type="text" onclick="if(this.value=='Email')this.value='';" onblur="if(this.value=='')this.value='Email';" /></li>
                  <li class="message"><label for="contactMessage">Message</label><textarea rows="5" cols="10" name="contactMessage" id="contactMessage" class="requiredField"><?php if(isset($_POST['contactMessage'])) { echo $_POST['contactMessage'];} else { echo "Message"; } ?></textarea></li>
                  <li><span class="required">All fields are required</span> <input type="hidden" name="checking" id="checking" value="<?php if(isset($_POST['checking']))  echo $_POST['checking'];?>" /><input type="hidden" name="submitted" id="submitted" value="true" /><input type="submit" name="submit" id="submit" value="" class="submit" /></li>
                </ul>
              </form>
            <?php } ?>
            </div>
            <!-- / contact form -->

Redagavo ZW· 2010 Gru. 26 19:12:02