Hi Frnds..
plz check below code & tell me how to create DB table,inserting values for checkboxes....
its urgent plz..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>shopping</title>




</head>

<body  class="bg">

<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td ><form name="form" action="submit.php" method="post"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFCC66">
      <tr valign="top">
        <td width="161" height="263" valign="top">
        <td width="609" align="center"><table width="100%" border="0">
          <tr>
            <td width="23%">FREE SAMPLES</td>
            <td width="27%">&nbsp;</td>
            <td width="20%">&nbsp;</td>
            <td width="30%">&nbsp;</td>
          </tr>
          <tr>
            <td>Company name : </td>
            <td><input type="text" name="cname" id="textfield" /></td>
            <td>Customer name : </td>
            <td><input type="text" name="cusname" id="textfield2" /></td>
          </tr>
          <tr>
            <td>Tel/Mobile : </td>
            <td><input type="text" name="phone" id="textfield3" /></td>
            <td>Fax number : </td>
            <td><input type="text" name="fax" id="textfield4" /></td>
          </tr>
          <tr>
            <td>Address : </td>
            <td><textarea name="address" id="textfield5" cols="21"></textarea></td>
            <td>State :</td>
            <td><input type="text" name="State" id="textfield6" /></td>
          </tr>
          <tr>
            <td>Post code :</td>
            <td><input type="text" name="post" id="textfield7" /></td>
            <td>E-Mail : </td>
            <td><input type="text" name="email" id="textfield8" /></td>
          </tr>
        </table>
          <table width="100%" border="0">
            <tr>
              <td>* please note that frieght will be charged to areas outside normal delivery routes.</br>This will be &nbsp;&nbsp;&nbsp;refunded in full should you become a customer. </td>
            </tr>
            <tr>
              <td>How did you hear about us :</td>
            </tr>
            <tr>
              <td><table width="100%" border="0">
                <tr>
                  <td width="39%">
                      <input type="checkbox" name="service[]" id="checkbox" value="See in Cafe" /> 
                      See in Cafe                  </td>
                  <td width="37%"><input type="checkbox" name="service[]" id="checkbox2" value="Referred by Friend/Employee"/> 
                    Referred by Friend/Employee</td>
                  <td width="24%"><input type="checkbox" name="service[]" id="checkbox3" value="Yellow Pages" />
                    Yellow Pages </td>
                </tr>
                <tr>
                  <td><input type="checkbox" name="service[]" id="checkbox"  value="White Pages"/>
                    White Pages</td>
                  <td><input type="checkbox" name="service[]" id="checkbox" value="YP Online" />
                    YP Online</td>
                  <td><input type="checkbox" name="service[]" id="checkbox6" value="Our Sales Rep."/>
                    Our Sales Rep.</td>
                </tr>
                <tr>
                  <td><input type="checkbox" name="service[]" id="checkbox7" value="Fine Foods/Tradeshows"/>
                    Fine Foods/Tradeshows</td>
                  <td><input type="checkbox" name="service[]" id="checkbox8" value="Through Internet" />
                    Through Internet</td>
                  <td><input type="checkbox" name="service[]" id="checkbox9" value="Other" />
                    Other</td>
                </tr>
              </table></td>
            </tr>
          </table>
          <table width="100%" border="0">
            <tr>
              <td width="39%">What type of business have you got?</td>
              <td width="37%"><input type="checkbox" name="service1[]" id="checkbox10" value="Sit down coffee shop" />
                Sit down coffee shop</td>
              <td width="24%"><input type="checkbox" name="service1[]" id="checkbox11" value="Franchise Business" />
                Franchise Business</td>
            </tr>
            <tr>
              <td><input type="checkbox" name="service1[]" id="checkbox12" value="Over the counter cafe/blosk" />
                Over the counter cafe/blosk</td>
              <td><input type="checkbox" name="service1[]" id="checkbox13"value="Restaurent"  />
                Restaurent</td>
              <td><input type="checkbox" name="service1[]" id="checkbox14" value="Other" />
                Other</td>
            </tr>
          </table>          
          <table width="100%" border="0">
            <tr>
              <td>Are you considering stocking the Laguna Range?</td>
            </tr>
            <tr>
              <td><input type="checkbox" name="service2[]" id="checkbox15" value="Yes Now?" />
                Yes Now? 
                <input type="checkbox" name="service2[]" id="checkbox16" value="With in 2 weeks"/>
                With in 2 weeks 
                <input type="checkbox" name="service2[]" id="checkbox17" value="With in 4 weeks"/>
                With in 4 weeks 
                <input type="checkbox" name="service2[]" id="checkbox18" value="More than 4 weeks"/>
                More than 4 weeks 
                <input type="checkbox" name="service2[]" id="checkbox19" value="No"/> 
                No</td>
            </tr>
            <tr>
              <td>Any particular product you are intrested in(see our Range)&nbsp; :
                <input type="text" name="product" id="textfield9" /></td>
            </tr>
            <tr>
              <td>Currently which manufacturer are you using &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
                <input type="text" name="manufacturer" id="textfield10" /></td>
            </tr>
            <tr>
              <td>Any questions or comments &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 
                <input type="text" name="comments" id="textfield11" /></td>
            </tr>
          </table>          
         
              <input type="submit" name="button" id="button" value="Submit" /> &nbsp;  &nbsp; &nbsp;
                    
              <input type="reset" name="button2" id="button2" value="Reset" />
            </td>
      </tr>

        </table>
    </form>
        </td>
        <td width="10" align="center">&nbsp;</td>
        
      </tr>
    </table></td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</td>
  </tr>
</body>
</html>

Thanks in advance..

Hi...
Thanks for giving reply..
Ok i know table creation..& also inserting data into table..
but i dont know about checkboxes..
thats the problem..
how to create table for checkboxes(array) in mysql..& also posting selected checkbox values..

Thanks in advance..

Hi frnds...
succesfully completed this query..
Thanks especially to Shanthi...

I have tried your code but it is showing message like
Undefined index: Services

Let me know the solution.

Thanks in advance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.