Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,487 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,697 people online right now. Registration is fast and FREE... Join Now!




need help how to make my database with this form..

 
Reply to this topicStart new topic

need help how to make my database with this form..

jojodalde
27 Jan, 2008 - 06:54 PM
Post #1

New D.I.C Head
*

Joined: 3 Jan, 2008
Posts: 10

hey guys, i have a problem on how to make my database with this form. i dont know whats the value on my radio buttons and checkbox, is it right to include the "questions" from form in my database? any idea how to do this? thanks! i have this code im my form.


CODE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Survey Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
.style3 {color: #a40597}
.style4 {font-size: 18px}
.style5 {font-family: "Arial Narrow"}
.style7 {font-family: "Arial Narrow"; font-style: italic; }
a:link {
    color: #669999;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #669999;
}
a:hover {
    text-decoration: none;
    color: #669999;
}
a:active {
    text-decoration: none;
    color: #669999;
}
-->
</style>
</head>
<body bgcolor=pink><center>
<table width="80%" bordercolor="pink" border="1" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<form name="form1" METHOD = "post" ACTION = "survey1.php">
     <tr>
           <td><img src="a2.jpg" width="850" height="400"></td>
     </tr>
     <tr>
         <td align="left"><br>
            <table border=0 width=80% align=center>
                <tr>
                    <td align="left" width="50"><font face="verdana,sans-serif" size="2" color="#990066">Lastname:</font></td>
                    <td align="left" width="150"> <input name="lname"  type="text" size="20" maxlength="20"></td>
                    <td align="right" width="90"><font face="verdana,sans-serif" size="2" color="#990066">Firstname:</font></td>
                    <td align="left" width="150"> <input name="fname"  type="text" size="20" maxlength="20"></td>
                    <td align="right" width="50"><font face="verdana,sans-serif" size="2" color="#990066">Age:</font></td>
                    <td align="left"> <input name="age"  type="text" size="1" maxlength="2"></td>
                </tr>
                <tr>
                    <td align="left" width="50"><font face="verdana,sans-serif" size="2" color="#990066">Address:</font></td>
                    <td colspan="6" align="left"><textarea name="address" cols="50" rows="2"></textarea></td>
                    <td></td>
                </tr>
                <tr>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">Email:</font></td>
                    <td align="left"><input name="email" type="text" size="20" maxlength="20"></td>
                    <td align="right"><font face="verdana,sans-serif" size="2" color="#990066">Cell Number:</font></td>
                    <td align="left"><input name="cnum"  type="text" size="11" maxlength="11"></td>
                </tr>
            </table><br><br>
             <table width="65%"border=0 align=center>
                <tr>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">
                            Which store are you referring to?</font>
                    </td>
                    <td align="left"> <input name="storename"  type="text" size="10" maxlength="10">
                       </td>
                 </tr>
                 <tr>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">
                                    What date and time did you visit the store?</font>
                    </td>
                    <td align="left"> <input name="date_visited"  type="text" size="30" maxlength="30"></td>
                </tr>
             </table>
             <br>
             <table border=0 bordercolor=blue width=60% align=center>
                 <tr>
                     <td width="" height=""></td>
                     <td align="left" width=""><font face="verdana,sans-serif" size="4" color="#990066">OUR SERVICE</font></td>
                    <td width=""><center><font face="verdana,sans-serif" size="3" color="#990066">5</font></center></td>
                    <td width=""><center><font face="verdana,sans-serif" size="3" color="#990066">4</font></center></td>
                    <td width=""><center><font face="verdana,sans-serif" size="3" color="#990066">3</font></center></td>
                    <td width=""><center><font face="verdana,sans-serif" size="3" color="#990066">2</font></center></td>
                    <td width=""><center><font face="verdana,sans-serif" size="3" color="#990066">1</font></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The Assisitance of the Sales Staff</font></td>
                    <td><center><input name="asst_ss1" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="asst_ss1" type="radio" value="radio2" ></center></td>
                    <td><center><input name="asst_ss1" type="radio" value="radio3" ></center></td>
                    <td><center><input name="asst_ss1" type="radio" value="radio4" ></center></td>
                    <td><center><input name="asst_ss1" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The Suggestions of the Sales Staff</font></td>
                    <td><center><input name="sugg_ss2" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="sugg_ss2" type="radio" value="radio2" ></center></td>
                    <td><center><input name="sugg_ss2" type="radio" value="radio3"></center></td>
                    <td><center><input name="sugg_ss2" type="radio" value="radio4" ></center></td>
                    <td><center><input name="sugg_ss2" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">My questions about the merchandise were answered</font></td>
                    <td><center><input name="questions_answered3" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="questions_answered3" type="radio" value="radio2" ></center></td>
                    <td><center><input name="questions_answered3" type="radio" value="radio3" ></center></td>
                    <td><center><input name="questions_answered3" type="radio" value="radio4"></center></td>
                    <td><center><input name="questions_answered3" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The quality of service of the counter</font></td>
                    <td><center><input name="quality_service_counter4" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="quality_service_counter4" type="radio" value="radio2" ></center></td>
                    <td><center><input name="quality_service_counter4" type="radio" value="radio3" ></center></td>
                    <td><center><input name="quality_service_counter4" type="radio" value="radio4" ></center></td>
                    <td><center><input name="quality_service_counter4" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The quality of service with personalized charms</font></td>
                    <td><center><input name="quality_service_pc5" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="quality_service_pc5" type="radio" value="radio2" ></center></td>
                    <td><center><input name="quality_service_pc5" type="radio" value="radio3" ></center></td>
                    <td><center><input name="quality_service_pc5" type="radio" value="radio4" ></center></td>
                    <td><center><input name="quality_service_pc5" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td height=""></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                     <td align="left" width=""><font face="verdana,sans-serif" size="4" color="#990066">OUR PRODUCTS</font></td>
                 </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The quality of hair accessories</font></td>
                    <td><center><input name="quality_of_ha6" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="quality_of_ha6" type="radio" value="radio2" ></center></td>
                    <td><center><input name="quality_of_ha6" type="radio" value="radio3" ></center></td>
                    <td><center><input name="quality_of_ha6" type="radio" value="radio4" ></center></td>
                    <td><center><input name="quality_of_ha6" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The quality of personalized charms</font></td>
                    <td><center><input name="quality_of_pc7" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="quality_of_pc7" type="radio" value="radio2" ></center></td>
                    <td><center><input name="quality_of_pc7" type="radio" value="radio3" ></center></td>
                    <td><center><input name="quality_of_pc7" type="radio" value="radio4" ></center></td>
                    <td><center><input name="quality_of_pc7" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The design of hair accessories</font></td>
                    <td><center><input name="design_of_ha8" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="design_of_ha8" type="radio" value="radio2" ></center></td>
                    <td><center><input name="design_of_ha8" type="radio" value="radio3" ></center></td>
                    <td><center><input name="design_of_ha8" type="radio" value="radio4" ></center></td>
                    <td><center><input name="design_of_ha8" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The design of personalized charms</font></td>
                    <td><center><input name="design_of_pc9" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="design_of_pc9" type="radio" value="radio2" ></center></td>
                    <td><center><input name="design_of_pc9" type="radio" value="radio3" ></center></td>
                    <td><center><input name="design_of_pc9" type="radio" value="radio4" ></center></td>
                    <td><center><input name="design_of_pc9" type="radio" value="radio5" ></center></td>
                </tr>
                <tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The affordability</font></td>
                    <td><center><input name="affordability10" type="radio" value="radio1">
                    </center></td>
                    <td><center><input name="affordability10" type="radio" value="radio2" ></center></td>
                    <td><center><input name="affordability10" type="radio" value="radio3" ></center></td>
                    <td><center><input name="affordability10" type="radio" value="radio4" ></center></td>
                    <td><center><input name="affordability10" type="radio" value="radio5" ></center></td>
                </tr>
              </table><br>
            <table width="70%" border=0 bordercolor=red align=center>
              <!--DWLayoutTable-->
                   <tr>
                       <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>How did you get to know our store?</b></font></td>
                   </tr>
                   <tr>
                       <td width=151 height="21"><input name="question1" type="checkbox" id="checkbox1" value="checkboxa">    <font face="verdana,sans-serif" size="1" color="#990066">Friend</font></td>
                       <td width=132><input name="question1" type="checkbox" id="checkbox1" value="checkboxb">    <font face="verdana,sans-serif" size="1" color="#990066">Print Ad</font></td>
                       <td colspan="3"><input name="question1" type="checkbox" id="checkbox1" value="checkboxc">    <font face="verdana,sans-serif" size="1" color="#990066">TV Ad</font></td>
                       <td colspan="2"></td>
                </tr>
                   <tr>
                       <td colspan=7><input name="question1" type="checkbox" id="checkbox1" value="checkboxd">    <font face="verdana,sans-serif" size="1" color="#990066">Just passed by</font>
                               <font face="verdana,sans-serif" size="1" color="#990066">    Others, specify</font>
                    <input name="other1" type="text" size="30" maxlength="30"></td>
                   </tr>
                   <tr>
                       <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>How often do you visit our store?</b></font></td>
                </tr>
                   <tr>
                       <td height="21" ><input name="question2" type="radio" value="radioa">
                           <font face="verdana,sans-serif" size="1" color="#990066">Daily</font></td>
                    <td colspan="6" ><input name="question2" type="radio" value="radiob" >    <font face="verdana,sans-serif" size="1" color="#990066">Weekly</font></td>
                </tr>
                <tr>
                       <td height="21" ><input name="question2" type="radio" value="radioc" >    <font face="verdana,sans-serif" size="1" color="#990066">Monthly</font></td>
                    <td colspan="6" ><input name="question2" type="radio" value="radiod" >    <font face="verdana,sans-serif" size="1" color="#990066">Firstime</font></td>
                </tr>
                <tr>
                       <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>What can you say about our store ambiance?</b></font></td>
                </tr>
                <tr>
                   <td height="24" ><input name="question3" type="radio" value="radioa">
                       <font face="verdana,sans-serif" size="1" color="#990066">Too Plain</font></td>
                    <td colspan="6" valign="top" ><input name="question3" type="radio" value="radiob" >                          <font face="verdana,sans-serif" size="1" color="#990066">Just attaractive</font></td>
                </tr>
                <tr>
                    <td colspan=7><input name="question3" type="radio" value="radioc" >    <font face="verdana,sans-serif" size="1" color="#990066">Too colorful</font>                
                    <font face="verdana,sans-serif" size="1" color="#990066">Others, specify</font>
                    <input name="other2" type="text" size="30" maxlength="30"></td>
                </tr>
                <tr>
                       <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>What can you say about our product assortment?</b></font></td>
                </tr>
                <tr>
                      <td height="21" ><input name="question4" type="radio" value="radioa">
                          <font face="verdana,sans-serif" size="1" color="#990066">For Kids</font></td>
                    <td colspan="6" ><input name="question4" type="radio" value="radiob" >    <font face="verdana,sans-serif" size="1" color="#990066">For Moms</font></td>
                </tr>
                <tr>
                  <td height="26" ><input name="question4" type="radio" value="radioc" >    <font face="verdana,sans-serif" size="1" color="#990066">For Teens</font></td>
                    <td colspan="6" valign="top" ><input name="question4" type="radio" value="radiod" >    <font face="verdana,sans-serif" size="1" color="#990066">For women of all ages</font></td>
                </tr>
                <tr>
                       <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>What products did you buy?</b></font></td>
                </tr>
                <tr>
                  <td height="28" ><input name="question5" type="checkbox" id="checkbox2" value="checkboxa">    <font face="verdana,sans-serif" size="1" color="#990066">Clips</font></td>
                    <td ><input name="question5" type="checkbox" id="checkbox2" value="checkboxb">    <font face="verdana,sans-serif" size="1" color="#990066">Clamps</font></td>
                  <td colspan="4" valign="top" ><input name="question5" type="checkbox" id="checkbox2" value="checkboxc">                        <font face="verdana,sans-serif" size="1" color="#990066">Personalized Charms</font></td>
                <td width="84"> </td>
                </tr>
                <tr>
                    <td height="21" ><input name="question5" type="checkbox" id="checkbox2" value="checkboxd">    <font face="verdana,sans-serif" size="1" color="#990066">Novelties</font></td>
                    <td ><input name="question5" type="checkbox" id="checkbox2" value="checkboxe">    <font face="verdana,sans-serif" size="1" color="#990066">Pony</font></td>
                    <td colspan="3" ><input name="question5" type="checkbox" id="checkbox2" value="checkboxf">    <font face="verdana,sans-serif" size="1" color="#990066">Headbands</font></td>
                       <td colspan="2"> </td>
                </tr>
                <tr>
                    <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>What attaracted you most in our store?</b></font></td>
                </tr>
                <tr>
                    <td height="21" ><input name="question6" type="radio" value="radioa">
                        <font face="verdana,sans-serif" size="1" color="#990066">Hair Accessories</font></td>
                    <td ><input name="question6" type="radio" value="radiob" >    <font face="verdana,sans-serif" size="1" color="#990066">Personal Charms</font></td>
                    <td colspan="3" ><input name="question6" type="radio" value="radioc" >    <font face="verdana,sans-serif" size="1" color="#990066">Store ambiance</font></td>
                    <td width="49"> </td>
                    <td> </td>
                </tr>
                <tr>
                    <td colspan=7><input name="question6" type="radio" value="radiod" >
                        <font face="verdana,sans-serif" size="1" color="#990066">Customer Service</font>                            <font face="verdana,sans-serif" size="1" color="#990066">Others, Specify</font>
                    <input name="other3" type="text" size="30" maxlength=" 30"></td>
                </tr>
                <tr>
                    <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>What it is in our store that you think needs improvement?</b></font></td>
                </tr>
                <tr>
                    <td colspan="7">    <textarea name="textarea1" cols="70"></textarea></td>
                </tr>
                <tr>
                    <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>What other products would you like to have in our store?</b></font></td>
                </tr>
                <tr>
                    <td colspan="7">    <textarea name="textarea2" cols="70"></textarea></td>
                </tr>
                <tr>
                    <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>I would like:</b></font></td>
                </tr>
                <tr>
                    <td align="left"><input name="question7" type="checkbox" id="checkbox3" value="checkboxa">    <font face="verdana,sans-serif" size="1" color="#990066">colognes</font></td>
                    <td align="left"><input name="question7" type="checkbox" id="checkbox3" value="checkboxb">    <font face="verdana,sans-serif" size="1" color="#990066">pens</font></td>
                    <td colspan="3" align="left"><input name="question7" type="checkbox" id="checkbox3" value="checkboxc">    <font face="verdana,sans-serif" size="1" color="#990066">towels</font></td>
                    <td colspan="2" align="left"><input name="question7" type="checkbox" id="checkbox3" value="checkboxd">    <font face="verdana,sans-serif" size="1" color="#990066">hankies</font></td>
                </tr>
                <tr>
                    <td align="left"><input name="question7" type="checkbox" id="checkbox3" value="checkboxe">    <font face="verdana,sans-serif" size="1" color="#990066">slippers</font></td>
                    <td align="left"><input name="question7" type="checkbox" id="checkbox3" value="checkboxf">    <font face="verdana,sans-serif" size="1" color="#990066">pencils</font></td>
                    <td colspan="3" align="left"><input name="question7" type="checkbox" id="checkbox3" value="checkboxg">    <font face="verdana,sans-serif" size="1" color="#990066">stationeries</font></td>
                    <td colspan="2" align="left"><input name="question7" type="checkbox" id="checkbox3" value="checkboxh">    <font face="verdana,sans-serif" size="1" color="#990066">cosmetics</font></td>
                </tr>
                <tr>
                    <td colspan=7 align="center"><font face="verdana,sans-serif" size="2" color="#990066"><b>OTHER Comments / Suggestions:</b></font></td>
                   </tr>
                <tr>
                    <td colspan="7"align="left">    <textarea name="com_sug" rows="3" cols="50"></textarea></td>
                </tr>
            </table>
            <table border=0 align=center width=80%>
                <tr>
                    <td colspan=2> </td>
                </tr>
                <tr>
                    <td align=right><input type="submit" value="Submit"></td>
                    <td align=left><input type="reset" value="Reset"></td>
                </tr>
                <tr align="left">
                    <td colspan=2> </td>
                </tr>
          </table>
        </td>
    </tr>
</form>
</table>
</center>
  </body>
</html>

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Need Help How To Make My Database With This Form..
27 Jan, 2008 - 10:06 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,993



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Right now I think this is more of a PHP question than a database question, moved smile.gif
User is offlineProfile CardPM
+Quote Post

naoshad
RE: Need Help How To Make My Database With This Form..
29 Jan, 2008 - 12:48 AM
Post #3

New D.I.C Head
*

Joined: 28 Jan, 2008
Posts: 1


My Contributions
You may try this:
CODE
<tr>
                    <td width="" height=""></td>
                    <td align="left"><font face="verdana,sans-serif" size="2" color="#990066">The Assisitance of the Sales Staff</font></td>
                    <td><center><input name="asst_ss1" type="radio" value="5">
                    </center></td>
                    <td><center><input name="asst_ss1" type="radio" value="4" >
                    </center></td>
                    <td><center><input name="asst_ss1" type="radio" value="3" >
                    </center></td>
                    <td><center><input name="asst_ss1" type="radio" value="2" >
                    </center></td>
                    <td><center><input name="asst_ss1" type="radio" value="1" >
                    </center></td>
                </tr>



$_POST[asst_ss1] is the variable which you have to access to get the user chice.

In the same way just change the value of the relevant check box's to access that value.

CODE

<tr>
                       <td colspan="7"><font face="verdana,sans-serif" size="2" color="#990066"><b>How did you get to know our store?</b></font></td>
                   </tr>
                   <tr>
                       <td width=151 height="21"><input name="question1" type="checkbox" id="checkbox1" value="Friend">    
                       <font face="verdana,sans-serif" size="1" color="#990066">Friend</font></td>
                       <td width=132><input name="question1" type="checkbox" id="checkbox1" value="Print Ad">    
                       <font face="verdana,sans-serif" size="1" color="#990066">Print Ad</font></td>
                       <td colspan="3"><input name="question1" type="checkbox" id="checkbox1" value="TV Ad">    
                       <font face="verdana,sans-serif" size="1" color="#990066">TV Ad</font></td>
                       <td colspan="2"></td>
                </tr>


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 07:31PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month