Results 1 to 1 of 1

Thread: Add auto email reply to this form

  1. #1
    Join Date
    Jul 2015
    Posts
    1
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Add auto email reply to this form

    Hi everybody.
    I have this registration form and I want to add auto replay after user fill the fields and press send. can someone help me with this issue? thanks a lot!
    This is the code:

    Code:
    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) {
    	exit;
    }
    /**
     * Full Content Template
     *
    Template Name:  Full Width Page (no sidebar)
     */
    get_header(); ?>
    <div id="content-full" class="grid col-940">
      <div class="post-entry">
        <?php
    	global $wpdb;
        $table_name = $wpdb->prefix . 'login';
        $count_query = "select count(*) from $table_name";
        $num = $wpdb->get_var($count_query);
        $arr = str_split(str_pad($num, 4, "0195", STR_PAD_LEFT)); 
    	//print_r($arr);
    	if(isset($_POST['uname']) && $_POST['email'] && $_POST['phone']){
    		$uname = $_POST['uname'];
    		$email = $_POST['email'];
    		$phone = $_POST['phone'];
    			$q = "INSERT INTO wp_login(uname, email, phone) VALUES ('$uname','$email','$phone')";
    			mysql_query($q)or die(mysql_error());
    			echo "!תודה רבה. ההרשמה בוצעה בהצלחה. יחד נשנה את עתיד השומרון";
    			echo "<style>
    			.post-entry {
        clear: both;
        font-size: 30px;
        background: #8EC63F;
        padding: 10px;
        margin: 60px 20px;
        text-align: center;
        color: #fff;
    }
    			</style>";
    		 exit;
       }
    ?>
        <div id="count">
          <div class="divf" style="border-top-left-radius: 10px;border-bottom-left-radius: 10px;"> <?php echo $arr['0'];?> </div>
          <div class="divf"> <?php echo $arr['1'];?> </div>
          <div class="divf"> <?php echo $arr['2'];?> </div>
          <div class="divf" style="border-top-right-radius: 10px;border-bottom-right-radius: 10px;"> <?php echo $arr['3'];?> </div>
        </div>
        <form name="myform" action="" method="POST">
            <div id="form">
            <ul>
              <li><input type="email" name="email" id="uemail" required></li>
              <li><input type="text" name="phone" id="upass" required></li>
              <li><input type="text" name="uname" placeholder="" id="uname" required></li>
              </ul>
              
              <div class="fb-share-button" data-href="http://demski.co.il/" data-layout="icon"><a href="http://www.facebook.com/sharer.php?u=http://demski.co.il
    &t=<שריה דמסקי, עושה באמת>"><img src="<?php bloginfo('template_url')?>/images/facebook_btn.png"> </a></div>
          </div>
            </div>
    
        </form>
        
                
      </div>
      </section>
    
    </style>
    </div>
    </div>
    <!-- end of #content-full --> 
    <script type="text/javascript">
    function submitform()
    {	
    	code="";
    	field1 = document.getElementById('uname').value;
    	field2 = document.getElementById('uemail').value;
    	field3 = document.getElementById('upass').value;
    	if(field3=="" && field1=="" && field2==""){
    		alert("נא למלא שם \n נא להוסיף כתובת מייל תקינה \n נא להוסיף מספר טלפון");
    		return ;
    	}
    	if(field1=="" || field1==null){
    		alert("נא למלא שם");
    		return ;
    	}
    	if(field2=="" || field2==null){
    		alert("נא להוסיף כתובת מייל תקינה");	
    		return ;
    	}
    	if(field3=="" || field3==null){
    		alert("נא להוסיף מספר טלפון");
    		return ;
    	}
    	
    	
    	if(field1!="" && field2!="" && field3!=""){
    		document.myform.submit();
    	}
      
    }
    
    
    </script>

  2. The Following User Says Thank You to netanel For This Useful Post:

    tranvanchienhn (08-04-2015)

Similar Threads

  1. Replies: 0
    Last Post: 09-26-2014, 11:58 PM
  2. Replies: 8
    Last Post: 02-09-2010, 06:07 AM
  3. Send auto reply to form field email address
    By stealthmode666 in forum PHP
    Replies: 5
    Last Post: 12-12-2008, 06:14 AM
  4. Replies: 10
    Last Post: 11-11-2008, 05:34 PM
  5. After a form submission have email auto sent
    By immersion08 in forum PHP
    Replies: 1
    Last Post: 09-24-2005, 02:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •