473,804 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is the feedback form is not submmiting

hi

i have created a feedback form , its working on wamp server but in online its not posting data to database. here am providing code please someone help me.

Feedback.php

Expand|Select|Wrap|Line Numbers
  1. <script language="javascript" type="text/javascript">
  2. function validate(nm, eml, fdk, ph)
  3. {
  4.    var name = document.getElementById(nm);
  5.    var email = document.getElementById(eml);
  6.    var feedback = document.getElementById(fdk);
  7.    var phone = document.getElementById(ph);
  8.    if (name.value == "")
  9.    {
  10.       alert("Please Enter Your Name..!");
  11.       name.focus();
  12.       return false;
  13.    }
  14.    if (email.value == "")
  15.    {
  16.       alert("Please Enter Email-id..!");
  17.       email.focus();
  18.       return false;
  19.    }
  20.    var emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/
  21.    var phone = /^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/
  22.    // var phoneRe = /^\d{10}(-)/
  23.    if ( ! emailRe.test(email.value))
  24.    {
  25.       alert('Email-id Is Invalid');
  26.       return false;
  27.    }
  28.    if (phone.value = "")
  29.    {
  30.       if ( ! phoneRe.test(phone.value))
  31.       {
  32.          alert('Phone Number Is Invalid');
  33.          return false;
  34.       }
  35.    }
  36.    if (feedback.value == "")
  37.    {
  38.       alert("Please Enter Your Feedback..!");
  39.       feedback.focus();
  40.       return false;
  41.    }
  42. }
  43.  
  44.     </script>
  45.  
  46. <form name="testform" method="post"action="submited.php">
  47.  
  48. Neme:<input type="text" name="name" id="name" maxlength="30" size="30" tabindex="1"/>
  49.  
  50. email<input type="text" name="email" id="email" maxlength="34" size="30" tabindex="3"/>
  51.  
  52. Feedback:<textarea name="feedback" rows="7" cols="24" id="feedback"  tabindex="4"></textarea>
  53.  
  54. Phone No:<input type="text" name="contactno" id="phone" maxlength="11" size="30" tabindex="2"/>
  55.  
  56. <input name="Submit" value="Submit" onclick="return validate('name','email','feedback','phone');"  type="submit" tabindex="5"/>
  57.  
  58.  
  59. </form>
  60.  
  61.  
Submited.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.         // opening connection
  3.                     $conn=mysql_connect("localhost","root","");
  4.         //  getting database to use
  5.                         mysql_select_db("school",$conn);
  6.         // Sql statements
  7.                 $Name=$_POST["name"];
  8.                 $Contactno=$_POST["contactno"];
  9.                 $Emailid=$_POST["email"];
  10.                 $Feedback=$_POST["feedback"];
  11.     $sql="INSERT INTO feedback values('','$Name','$Contactno','$Emailid','$Feedback')";
  12.         // execute statements
  13.                 $result=mysql_query($sql,$conn);    
  14.                 if($result==1)
  15.                     echo"<font color=black face=Verdana, Arial, Helvetica, sans-serif style=font-size:12px>";
  16.                     echo"Thanks for your feedback,we will get back to you Soon.";
  17.                     echo"</font>";
  18.                     echo"<br><br>";
  19.                     ?>
  20.  
mysql table:
Expand|Select|Wrap|Line Numbers
  1. feedback` (
  2.   `Id` int(11) NOT NULL AUTO_INCREMENT,
  3.   `Name` varchar(30) NOT NULL,
  4.   `Contactno` varchar(60) NOT NULL,
  5.   `Emailid` varchar(40) NOT NULL,
  6.   `Feedback` varchar(500) NOT NULL,
  7.   PRIMARY KEY (`Id`)
  8. )
Oct 28 '10 #1
1 1530
Markus
6,050 Recognized Expert Expert
Turn error reporting on:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // Very top of your script
  3. ini_set('display_errors', 1);
  4. error_reporting(-1);
  5.  
Check that your connect to the database and selecting of database worked:

Expand|Select|Wrap|Line Numbers
  1. $conn = mysql_connect('localhost', 'root', '');
  2. if (!$conn)
  3. {
  4.   printf("Error when trying to connect to MySQL server: %s", mysql_error());
  5. }
  6. else
  7. {
  8.   // Do rest
  9. }
  10.  
Also, the mysql_* functions are outdated and have been superseded. Use MySQLi or PDO instead.
Oct 28 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5114
by: Andrew | last post by:
Where can i find a free feedback form in php script to download it and put it in my website? thanks in advance andreas
2
5226
by: Mindful_Spirit | last post by:
I'm trying to set up a basic email feed back form like this, and was wondering about some basic configuration settings. I have used code from this website. I have it working just fine. I'm running IIS on my home machine. My problem is that I need to upload this stuff to a webhosting place and register a domain and I'm not sure what to put as the smtp mail server value
1
5952
by: Andrew | last post by:
Where can i find a free feedback form in javascript to download it and put it in my website? thanks in advance andreas
7
1927
by: Armand Karlsen | last post by:
On one page of a site I'm doing for a college project, I have a feedback form: http://www.zen62775.zen.co.uk/Test/contact/contact_feedback.html All parts of this page validate, except for the hidden portions of the form, used for setting the recipient address, sender address, etc... ...
6
1679
by: Zagor | last post by:
I have a feedback form in my website with three TextBoxes and a SEND button in a user control. Below is a piece of the code: //On click event for the send LinkButton private void SendClicked(object sender, EventArgs e){ try{ if (Page.IsValid){
1
3013
by: Mario Krsnic | last post by:
Hello! I made a feedback form using ASP.NET and VB.NET. It works, but I receive allways two mails from server instead of one. Why? Thanks for every idea! Mario Here the code: Imports System.web.Mail Partial Class _Default
0
1509
by: vijay | last post by:
hello friends, I have done one website by using frontpage 2005 and i have done the feedback form.Now I want to send this feedback form to email id.I have used mailto: in form tag but it is not working.so What is the solution.
1
1625
by: lali | last post by:
hi everybody, i am doing a project and i have strucked in middle of my code usiong asp. the problem is, in the feedback form there are many fields which are manidatory.when an user fills the form and clicks on submit button all the fields in the feedback form should be sent as the mail to the company who are providing feedback form can anybody help me out by giving me code?
15
2659
by: nickyspace | last post by:
i have a code wherein it is asking email id and message from the user in the form named as feedback.html HTML CODE AS BELOW<html> <body> <form method="post" action="sendmail.php"> Email: <input name="email" type="text" size="20" /><br /> Message:<br /> <textarea name="message" rows="15" cols="40"> </textarea><br /> <input type="submit" /> </form>
0
1428
by: gnawz | last post by:
I have a feedback form code which does email but does not display the correct content. In place of the email address, it displays "+1" And the body message is "1" It works well when I test it on localhost. As in
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10311
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5516
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2988
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.