Author Topic: Contact Form php  (Read 542 times)

Vask0

  • Regular Member
  • **
  • Posts: 27
  • Karma: 0
    • View Profile
Hello I need php code, to finish this code..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  
  <!-- Contact Form Start -->
   <form method="post" id="contact_form" action="contact.php">
   <input type="text" id="contact_name" name="name" class="form-control contact_input_box wow fadeInUp" placeholder="Име" required/>
   <input type="email" id="contact_email" name="email" class="form-control contact_input_box wow fadeInUp" placeholder="E-mail" required/>
   <textarea id="contact_text" name="message" rows="5" cols="30" class="form-control contact_input_box wow fadeInUp" placeholder="Напишете вашето съобщение към нас!!!" required></textarea>
   <button type="submit" class="btn btn-primary contact_button wow fadeInUp"> <i class="fa fa-send-o"></i>  Изпрати</button>
   </form>
   <!-- Contact Form End -->
  </div>
  </div>
  </div>
  </div>
  </div>
  </div>
  </div>
  </section>
 


Ajax Submiting

Code: [Select]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  
  <script>
  [b] /* ==============================================
   Ajax Submiting For Email Subscriber Form.
   =====================================================================*/ [/b]
   $("#subscriber_form").submit(function(e)
   {
   $('#show_subscriber_msg').html('<div class=gen>Submiting..</div>');
   var subscriberemail = $('#subscriberemail').val();
  var formURL = $(this).attr("action");
  var data = {
  subscriberemail:subscriberemail
     }
  $.ajax(
  {
  url : formURL,
  type: "POST",
  data : data,
 
  success: function (res) {
  if(res=='1'){
  $('#show_subscriber_msg').html('<div class=gen>Thank you very much, We will notify you when we lunch</div>');
  }
 
  if(res=='5'){
  $('#show_subscriber_msg').html('<div class=err>Please enter a valid email address</div>');
  }
  }
  });
  e.preventDefault(); //STOP default action
  });
 [b] /* ==============================================
  Ajax Submiting For Email Contact Form.
  =====================================================================*/ [/b]
  $("#contact_form").submit(function(e)
  {
  $('#show_contact_msg').html('<div class=gen>Submiting..</div>');
  var username = $('#contact_name').val();
  var useremail = $('#contact_email').val();
  var commenttext = $('#contact_text').val();
  var formURL = $(this).attr("action");
  var data = {
  username:username,
  useremail:useremail,
  commenttext:commenttext,
     }
  $.ajax(
  {
  url : formURL,
  type: "POST",
  data : data,
 
  success: function (res) {
  if(res=='1'){
  $('#show_contact_msg').html('<div class=gen>Thank you very much, We will notify you when we lunch</div>');
  }
 
  if(res=='5'){
  $('#show_contact_msg').html('<div class=err>Please enter a valid email address</div>');
  }
  }
  });
  e.preventDefault(); //STOP default action
  });
  </script>
 
 

thanks in advance!!!!!

PHP Help Forum

Contact Form php
« on: January 29, 2017, 11:42:38 am »


JimL

  • Master PHP Helper
  • Senior Member
  • *
  • Posts: 1729
  • Karma: 155
  • function deleteUsers(Vector<User> $users): void {}
    • View Profile
The only place success comes before work is in the dictionary. - Vince Lombardi

I won't help if you're using mysql_* functions | You should use PDO | MariaDB | Netbeans IDE | About me

PHP Help Forum

Re: Contact Form php
« Reply #1 on: January 29, 2017, 01:20:29 pm »



PHP Help Forum

Re: Contact Form php
« Reply #2 on: January 29, 2017, 01:45:42 pm »



PHP Help Forum

Re: Contact Form php
« Reply #3 on: January 31, 2017, 02:51:20 am »


astonecipher

  • Software Engineer
  • Professional PHP Helper
  • Senior Member
  • *
  • Posts: 2417
  • Karma: 95
    • View Profile
@stepinsolutions , I don't really like spam. So, I am going to trim your post.
Questions? Go here first.
http://www.phptherightway.com/

PHP Help Forum

Re: Contact Form php
« Reply #4 on: March 29, 2017, 08:24:16 am »


Kevin Rubio

  • Professional PHP Helper
  • Senior Member
  • *
  • Posts: 1755
  • Karma: 105
  • Programmer Available for hire
    • View Profile
    • Galaxy Internet
PDO Bumpstart Database

The XY Problem
The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help. http://xyproblem.info/

PHP Help Forum

Re: Contact Form php
« Reply #5 on: March 29, 2017, 02:03:50 pm »