Form placement in a div [closed] - php

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I tried to create a form that covers almost all of the content of my page. Since the input field is scattered, it verifies but still proceeds to the next page afterwards. I don't know what the problem is; it works fine in HTML and PHP formats when I try it offline. The problem happens when I upload it to the server.
The script:
<form method="post" action="step.php" id="form1">
<div id="content">
<center>
<br><br><br>
<input id="sig" name="sig" type="text" class="validate[sign] text-input" style="margin-left:-180px;visibility:hidden;height:0px;"/>
<div id="signatureparent">
<div id="signature"></div>
</div>
</div>
</center>
<!====================================================================================>
<div id="content">
<div id="wrapper">
<div id="form-div">
<center><strong>Please enter the information for the person who will be the primary contact for our account set up team. If left blank we will use the information in the billing section.</strong></center>
<div id="wrapper3">
<div id="form-div">
<center>
<table cellpadding='0' cellspacing='27'>
<tr>
<td>
<!====================================================================================>
<div style="display:none">
<label for="name"><strong>First Name<font color=red size=3> *</font></strong></label>
<p class="name">
<input name="name" readonly="readonly" type="text" class="validate[custom[name]] text-input" id="Name" value="<?php echo $_POST["name"]; ?>" />
</p>
<label for="last" style="margin-left:45px;"><strong>Last Name<font color=red size=3> *</font></strong></label>
<p class="last">
<input name="last" style="margin-left:45px;" readonly="readonly" type="text" class="validate[custom[last]] text-input" id="last" value="<?php echo $_POST["last"]; ?>" />
</p>
</div>
<!====================================================================================>
<label for="cname"><strong>First Name<font color=red size=3> *</font></strong></label>
<p class="cname">
<input name="cname" type="text" class="validate[custom[cname]] text-input" id="cname" value="" />
</p>
<label for="cemail"><strong>E-mail<font color=red size=3> *</font></strong></label>
<p class="cemail">
<input name="cemail" type="text" class="validate[custom[cemail]] text-input" id="cemail" value="" />
</p>
<!====================================================================================>
</td><td>
<label for="clast" style="margin-left:45px;"><strong>Last Name<font color=red size=3> *</font></strong></label>
<p class="clast">
<input name="clast" style="margin-left:45px;" type="text" class="validate[custom[clast]] text-input" id="clast" value="" />
</p>
<label for="cphone" style="margin-left:45px;"><strong>Phone<font color=red size=3> *</font></strong></label>
<p class="cphone">
<input type="text" class="validate[custom[mob]] text-input" name="cphone" id="cphone" style="margin-left:45px;width:100px" />
<b>ext</b><input style="width:25px; margin-left:5px;" type="text" class="validate[custom[ext]] text-input" name="cext1" id="cext1" />
</p>
</td><td>
<!====================================================================================>
<label for="ccom" style="margin-left:45px;"><strong>Company<font color=red size=3> *</font></strong></label>
<p class="com">
<input type="text" class="validate[custom[ccom]] text-input"name="ccom" id="ccom" onblur="this.value = this.value.toTitleCase();" style="margin-left:45px;" />
</p>
<label for="cmob" style="margin-left:45px;"><strong>Mobile#</strong></label>
<p class="mob">
<input type="text" class="validate[custom[mob]] text-input" name="cmob" id="cmob" style="margin-left:45px;width:100px;" />
<b>ext</b><input style="width:25px; margin-left:5px;" type="text" class="validate[custom[ext]] text-input" name="cext2" id="cext2" />
</p>
</div></div></div></div></div>
</center>
</td></tr></table>
<div>
<!====================================================================================>
<br>
<div id="wrapper">
<div id="form-div">
<table><tr><td><div style="margin-left:210px;" >
<p><font color=red size=2%><b>Clicking this button means that you accept the terms and conditions of our service </b></font></td><td>
<div id="accept"><button style="margin-left:10px;border: 0; background: transparent" type="submit"><img src=img/acept.png height=30 /></button>
</div>
</tr></td></table>
</div>
</div>
<br><br><br>
</form>
It should first verify the contents, then proceed.

It appears that your form does not run any code on submitting it. You'd want your form to have:
<form method="post" action="step.php" id="form1" onsubmit="return validate()">
This is assuming that your validation code is as a JavaScript function.

Related

Created simple HTML form with PHP, but won't POST email and opens blank page

I created the following HTML and PHP documents. When I fill in the information and click submit, I don't receive any errors, but I get a blank page and also don't receive an email with the form information. I'm fairly new at this, but could use the help on why I'm not getting the email and how to get rid of the blank page. Thank you.
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<div id="title">
<div id="titlecontact">
<h1>Excelerate Growth, LLC</h1>
<h4><em>Consulting to Help Small Businesses Excel</em></h4>
</div>
</div>
<header id="header">
<nav class="links" style="--items: 5;">
Home
About
Services
Results
Contact
<span class="line"></span>
</nav>
</header>
<?=$thankYou ?>
<form class="form" action="contact2.php" method="POST">
<h1>CONTACT US</h1>
<p class="name">Name</p><input class="nametext" type="text" name="sender" />
<p class="email">Email</p><input class="emailtext" type="text" name="senderEmail" />
<p class="phone">Phone</p><input class="phonetext" type="tel" name="senderPhone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" required />
<br />
<br />
<p class="interest">Interest</p>
<select class="package" name="type" size="1">
<option value="update">Free Consultation</option>
<option value="change">Growth Management</option>
<option value="addition">Customer Service</option>
<option value="new">Process Management</option>
</select>
<br />
<br />
<p class="message">Share More About Your Business</p><textarea class="text" name="message" rows="6" cols="25"></textarea><br /><br />
<input class="submit" type="submit" value="Send"><input class="reset" type="reset" value="Clear">
</form>
<div id="social">
<img class="linkedin" src="linkedin.png">
<img class="email2" src="email.png">
<img class="facebook" src="facebook.png">
<br/>
<br/>
</div>
<br/>
<br/>
<?php
if($_POST["submit"]) {
$recipient="jscotty78#gmail.com";
$subject="Form to email message";
$sender=$_POST["sender"];
$senderEmail=$_POST["senderEmail"];
$senderPhone=$_POST["senderPhone"];
$type=$_POST["type"];
$message=$_POST["message"];
$mailBody="Name: $sender\nEmail: $senderEmail\nPhone: $senderPhone\nType: $type\n$message";
mail($recipient, $subject, $mailBody, "From: $sender <$senderEmail>");
$thankYou="<p>Thank you! Your message has been sent.</p>";
}
?>
Try This Code Below with name="submit"
<form class="form" action="contact2.php" method="POST">
<h1>CONTACT US</h1>
<p class="name">Name</p><input class="nametext" type="text" name="sender" />
<p class="email">Email</p><input class="emailtext" type="text" name="senderEmail" />
<p class="phone">Phone</p><input class="phonetext" type="tel" name="senderPhone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" required />
<br />
<br />
<p class="interest">Interest</p>
<select class="package" name="type" size="1">
<option value="update">Free Consultation</option>
<option value="change">Growth Management</option>
<option value="addition">Customer Service</option>
<option value="new">Process Management</option>
</select>
<br />
<br />
<p class="message">Share More About Your Business</p><textarea class="text" name="message" rows="6" cols="25"></textarea><br /><br />
<input class="submit" type="submit" name="submit" value="Send"><input class="reset" type="reset" value="Clear">
</form>
POST form data is sent using name => value. Here:
<form class="form" action="contact2.php" method="POST">
<h1>CONTACT US</h1>
<p class="name">Name</p><input class="nametext" type="text" name="sender" />
<p class="email">Email</p><input class="emailtext" type="text" name="senderEmail" />
<p class="phone">Phone</p><input class="phonetext" type="tel" name="senderPhone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" required />
<br />
<br />
<p class="interest">Interest</p>
<select class="package" name="type" size="1">
<option value="update">Free Consultation</option>
<option value="change">Growth Management</option>
<option value="addition">Customer Service</option>
<option value="new">Process Management</option>
</select>
<br />
<br />
<p class="message">Share More About Your Business</p><textarea class="text" name="message" rows="6" cols="25"></textarea><br /><br />
<input class="submit" type="submit" value="Send"><input class="reset" type="reset" value="Clear">
</form>
you have no input with name="submit". This is why $_POST['submit'] is equal to "", which is considered false in PHP. So mail() is not running.
Instead, try this:
<form class="form" action="contact2.php" method="POST">
<h1>CONTACT US</h1>
<p class="name">Name</p><input class="nametext" type="text" name="sender" />
<p class="email">Email</p><input class="emailtext" type="text" name="senderEmail" />
<p class="phone">Phone</p><input class="phonetext" type="tel" name="senderPhone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" required />
<br />
<br />
<p class="interest">Interest</p>
<select class="package" name="type" size="1">
<option value="update">Free Consultation</option>
<option value="change">Growth Management</option>
<option value="addition">Customer Service</option>
<option value="new">Process Management</option>
</select>
<br />
<br />
<p class="message">Share More About Your Business</p><textarea class="text" name="message" rows="6" cols="25"></textarea><br /><br />
<input class="submit" type="submit" value="Send"><input class="reset" type="reset" value="Clear">
<input type="hidden" name="submit" value="a" />
</form>
Notice name="submit". This gets sent along with the form data.

Autofilling a form with data from a previous form

I have 3 forms in an accordion, one for personal details, billing info and delivery info. I want to autofill the form in the delivery info section if the 'yes' radio button is selected when being asked if their billing and delivery info are the same.
I've looked on the web and can't seem to find anything on filling in a form in an accordion or on the same page.
Here is the HTML:
Details
<img class="editcheckoutbtn" src="<?php echo ROOT; ?>/Images/Buttons/rentals_84x25_edit.png">
<div class="inputsection details">
<form id="detailsform">
<label for="firstname">First Name*</label>
<input type="text" name="forename" />
<label for="lastname">Last Name*</label>
<input type="text" name="surname" />
<label for="email">Email*</label>
<input type="email" name="email" />
<label for="contactnumber">Contact Number*</label>
<input type="text" name="contactnumber"/>
<p class="marketingtext">Do you wish to be contacted by Interski with future promotions?</p>
<label>
<input type="radio" name="marketing" value="yes"/>Yes
</label>
<label>
<input type="radio" name="marketing" value="no"/>No
</label>
<div class="confirmdetailsbtn">
<input type="image" src="<?php echo ROOT; ?>/Images/Buttons/rentals_84x25_confirm.png">
</div>
</form>
</div>
<h3>billing address</h3>
<img class="editcheckoutbtn" src="<?php echo ROOT; ?>/Images/Buttons/rentals_84x25_edit.png">
<div class="inputsection billing">
<form id="billingform">
<label for="firstaddress">1st line of Address*</label>
<input type="text" name="firstaddress"/>
<label for="secondaddress">2nd line of Address</label>
<input type="text" name="secondaddress"/>
<label for="town">Town*</label>
<input type="text" name="town" />
<label for="postcode">Postcode*</label>
<input type="text" name="postcode" />
<label for="country">Country*</label>
<select name="country">
<option></option>
</select>
<p class="billingtext">Is your delivery address the same as your billing address?</p>
<label>
<input type="radio" id="deliveryyes" name="deliveryradio" value="yes"/>Yes
</label>
<label>
<input type="radio" id="deliveryno" name="deliveryradio" value="no"/>No
</label>
<div class="confirmbillingbtn">
<input type="image" src="<?php echo ROOT; ?>/Images/Buttons/rentals_84x25_confirm.png">
</div>
</form>
</div>
<h3>Delivery Address</h3>
<img class="editcheckoutbtn" src="<?php echo ROOT; ?>/Images/Buttons/rentals_84x25_edit.png">
<div class="inputsection delivery">
<form id="deliveryform">
<label for="firstaddress">1st line of Address*</label>
<input type="text" name="delfirstaddress" required/>
<label for="secondaddress">2nd line of Address</label>
<input type="text" name="delsecondaddress"/>
<label for="town">Town*</label>
<input type="text" name="deltown" />
<label for="postcode">Postcode*</label>
<input type="text" name="delpostcode" />
<label for="country">Country*</label>
<select name="delcountry">
<option></option>
</select>
<div class="confirmdeliverybtn">
<input type="image" src="<?php echo ROOT; ?>/Images/Buttons/rentals_84x25_confirm.png">
</div>
<div id="confirmbtn">
<input type="image" src="<?php echo ROOT; ?>/Images/Buttons/rentals_200x38_proceed_to_payment.png">
</div>
This is in complete assumption that as you mentioned its accordion,your page is not refreshed.
You can simply add an event listener on your Radio button to access the required fields and then use them to show wherever required.
Also give proper id's to your input fields
You can do it like this;
$("#deliveryyes").on('click',function(){
var firstaddress = $("#firstaddress").val();
...
// Use those values to populate other fields like
$("#delfirstaddress").val(firstaddress );
...
});
This way you can achieve it.

How to fix error in html [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I have created one HTML form and i have written php script also to connect to database. If i enter data in form and hit UPDATE button in form, its showing error like below,
<form action="process.php" method="Post"/>
<style>
p{
float:left;
}
</style>
<fieldset>
<legend align="center"><FONT color=default>Enter information Of SO's</legend>
<p align="center">
<label for="SO_ID"><FONT color=white>SO_ID</label>
<br/>
<input type="varchar" id="SO_ID" name="SO_ID"required/>
</p>
<p align="center">
<label for="No.of_samples"><FONT color=white>No.of samples</label>
<br/>
<input type="int" id="No.of_samples" name="No.of_samples"required/>
</p>
<p align="center">
<label for="Sample name"><FONT color=white>Sample name</label>
<br />
<input type="varchar" id="Sample name" name="Sample name"required/>
</p>
<p align="center">
<label for="Client name"><FONT color=white>Client name</label>
<br />
<input type="text" id="Client name" name="Client name"required/>
</p>
<p align="center">
<label for="Institution"><FONT color=white>Institution</label>
<br/>
<input type="text" id="Institution" name="Institution"required/>
</p>
<p align="center">
<label for="Run number "><FONT color=white>Run number </label>
<br/>
<input type="int" id="Run number" name="Run number"required/>
</p>
<p align="center">
<label for="Obtained reads"><FONT color=white>Obtained reads</label>
<br/>
<input type="int" id="Obtained reads" name="Obtained reads"required/>
</p>
<p align="center">
<label for="Re run Info"><FONT color=white>Re run Info</label>
<br/>
<input type="text" id="Re run Info" name="Re run Info"required/>
</p>
<p align="center">
<label for="Total reads"><FONT color=white>Total reads</label>
<br/>
<input type="int" id="Total reads" name="Total reads"required/>
</p>
<p align="center">
<label for="Run date"><FONT color=white>Run date</label>
<br/>
<input type="date" id="Run date" name="Run date"required/>
</p>
<p align="center">
<label for="Raw data location"><FONT color=white>Raw data location</label>
<br/>
<input type="varchar" id="Raw data location" name="Raw data location"required/>
</p>
<p align="center">
<label for="Analyst"><FONT color=white>Analyst</label>
<br/>
<input type="varchar" id="Analyst" name="Analyst"required/>
</p>
<p align="center">
<label for="Mentor"><FONT color=white>Mentor</label>
<br/>
<input type="text" id="Mentor" name="Mentor"required/>
</p>
<p align="center">
<label for="Analysis start date"><FONT color=white>Analysis start date</label>
<br/>
<input type="date" id="Analysis start date" name="Analysis start date"required/>
</p>
<p align="center">
<label for="Analysis end date"><FONT color=white>Analysis end date</label>
<br/>
<input type="date" id="Analysis end date" name="Analysis end date"required/>
</p>
<p align="center">
<label for="Report location"><FONT color=white>Report location</label>
<br/>
<input type="varchar" id="Report location" name="Report location"required/>
</p>
</fieldset>
<div style="text-align:center">
<button action= "process.php" method="post" >
<img alt="ok" src=
"http://www.blueprintcss.org/blueprint/plugins/buttons/icons/tick.png" />
UPDATE
</button>
</form>
the above script is saved in "process.html"
now below PHP script.
<?php
define('DB_NAME','ProcessTrackingSystem');
define('DB_USER','root');
define('DB_PASSWORD','');
define('DB_HOST','localhost');
$link=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$link){
die('couldnot connect:'.mysql_error());
}
$db_selected=mysql_select_db(DB_NAME,$link);
if(!$db_selected){
die('cannot use'.DB_NAME.':'.mysql_error());
}
$value1 =$_POST['SO_ID'];
$value2 =$_POST['No.of samples'];
$value3 =$_POST['Sample name'];
$value4 =$_POST['Client name'];
$value5 =$_POST['Institution'];
$value6 =$_POST['Run number '];
$value7 =$_POST['Obtained reads'];
$value8 =$_POST['Re run Info'];
$value9 =$_POST['Total reads'];
$value10 =$_POST['Run date'];
$value11 =$_POST['Raw data location'];
$value12 =$_POST['Analyst'];
$value13 =$_POST['Mentor'];
$value14 =$_POST['Analysis start date'];
$value15 =$_POST['Analysis end date'];
$value16 =$_POST['Report location'];
$sql="INSERT INTO ProcessDetails (SO_ID, No.of_samples, Sample_name, Client_name, Institution, Run_number, Obtained_reads, Re_run_Info, Total_reads, Run_date, Raw_data_location, Analyst, Mentor, Analysis_start_date, Analysis_end_date, Report_location) VALUES ('$value1', '$value2', '$value3', '$value4', '$value5','$value6', '$value7', '$value8', '$value9', '$value10','$value11', '$value12', '$value13', '$value14', '$value15','$value16')";
if(!mysql_query($sql)){
die('error:'.mysql_error());
}
header('Location:process.html');
mysql_close();
?>
now if i enter the data into html form, its showing error that "error:Unknown column 'No.of_samples' in 'field list'".
anyone help me out to fix this error and get desired output.
Thanks in advance....
Assuming that a No.of_samples column exists in your table, quote the name with backticks (`) in your query:
$sql="INSERT INTO ProcessDetails (SO_ID, `No.of_samples`, Sample_name, Client_name, Institution, Run_number, Obtained_reads, Re_run_Info, Total_reads, Run_date, Raw_data_location, Analyst, Mentor, Analysis_start_date, Analysis_end_date, Report_location) VALUES ('$value1', '$value2', '$value3', '$value4', '$value5','$value6', '$value7', '$value8', '$value9', '$value10','$value11', '$value12', '$value13', '$value14', '$value15','$value16')";
Also, you might want to look into SQL injection security risks, and into using the non-deprecated mysqli_* functions instead of the deprecated mysql_* ones.
You are inserting to column No.of_samples which does not exist!

Why the mysql code is not submitting values in database

This is the code for the form:
<div id="regform">
<div id="regform-top">
<h2>User Registration</h2>
<p>Please complete this form</p>
</div>
<form id="register-form" name="register-form" action="submit.php" method="post"
class="validation">
<fieldset>
<table>
<tr>
<td>
<div class="fieldgroup">
<label for="user-name">User name*: </label>
<input type="text" id="name" name="name" value="" size="12" class="inpt" /><br
class="clear" />
</div>
<div class="fieldgroup">
<label for="password">Password*: </label>
<input type="password" id="password" name="password" value="" size="12" class="inpt"
/><br class="clear" />
</div>
</td>
<td id="form-note">
<br />
<p><strong>Form Instructions</strong></p>
<p>*Required Field</p>
</td>
</tr>
</table>
<table id="bottom-reg">
<tr>
<td><br />
<div class="fieldgroup">
<label for="firstname">First name*</label>
<input type="text" id="firstname" name="firstname" value="" size="12" class="inpt" />
<br class="clear" />
</div>
<div class="fieldgroup">
<label for="email">Email Address* </label>
<input type="text" id="email" name="email" value="" size="12" class="inpt" /><br
class="clear" />
</div>
<div class="fieldgroup">
<label for="address1">Address 1* </label>
<input type="text" id="address1" name="address1" value="" size="12" class="inpt" />
<br class="clear" />
</div>
<label for="address2">Address 2</label>
<input type="text" id="address2" name="address2" value="" size="12" class="inpt" />
<br class="clear" />
<label for="address2">Address 3</label>
<input type="text" id="address3" name="address3" value="" size="12" class="inpt" />
<br class="clear" />
<div class="fieldgroup">
<label for="country">Country*</label>
<input type="text" id="country" name="country" value="" size="12" class="inpt" /><br
class="clear" />
</div>
</td>
<td><br />
<div class="fieldgroup">
<label for="lastname">Last name*</label>
<input type="text" id="lastname" name="lastname" value="" size="12" class="inpt" />
<br class="clear" />
</div>
<div class="fieldgroup">
<label for="group">Group* </label>
<input type="text" id="name" name="group" value="" size="12" class="inpt" />
<br class="clear" />
</div>
<div class="fieldgroup">
<label for="city">City* </label>
<input type="text" id="city" name="city" value="" size="12" class="inpt" /><br
class="clear" />
</div>
<div class="fieldgroup">
<label for="city">State* </label>
<input type="text" id="state" name="state" value="" size="12" class="inpt" /><br
class="clear" />
</div>
<div class="fieldgroup">
<label for="zip">Zip*</label>
<input type="text" id="zip" name="zip" value="" size="12" class="inpt" /><br
class="clear" />
</div>
</td>
</tr>
</table>
<input type="submit" value="Register" class="submit-btn" />
</fieldset>
</form>
This is the code for submit.php:
<?php
$con = mysql_connect("localhost","viatechp_invacar","storefront72");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("viatechp_invacare", $con);
$sql="INSERT INTO registration(username,password,fname,lname,group,
address1,address2,address3, email,city,state,zip,country )
VALUES
('$_POST[name]','$_POST[password]', '$_POST[firstname]','$_POST[lastname]','
$_POST[group]','$_POST[address1]','$_POST[address2]','$_POST[address3]',
'$_POST[email]','$_POST[city]','$_POST[state]','$_POST[zip]','$_POST[country]'
)" ;
$query = mysql_query($sql) or die(mysql_error());
$results = mysql_fetch_assoc($query);
if ($results) {
echo 'The query returned ' . $results[ 'registration' ];
} else {
echo 'The query did not return any results';
} ?>
echo $sql;
?>
It is showing an error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group,address1,address2,address3,email,city,state,zip,country ) VALUES ( 'sdfdsf' at line 1
group is an SQL keyword. If this is the name of one of your fields you must enclose it with ` like so:
`group`,`address1`,...
This tells mySQL that it is a field name and not the keyword. It would be good practice to enclose all your fields within ` to prevent any errors like this you may not have noticed.
Spot on by pburgess. GROUP, ORDER are some common field names that we use while programming. Make sure to enclose these using backticks group, always a good practice.
$sql="INSERT INTO registration(username,password,fname,lname,`group`,
address1,address2,address3, email,city,state,zip,country )
VALUES
('$_POST[name]','$_POST[password]', '$_POST[firstname]','$_POST[lastname]','
$_POST[group]','$_POST[address1]','$_POST[address2]','$_POST[address3]',
'$_POST[email]','$_POST[city]','$_POST[state]','$_POST[zip]','$_POST[country]'
)" ;
Try this
$sql="INSERT INTO registration(`username`,`password`,`fname`,`lname`,`group`,
`address1`,`address2`,`address3`, `email`,`city`,`state`,`zip`,`country` )
VALUES
('$_POST[name]','$_POST[password]', '$_POST[firstname]','$_POST[lastname]',
'$_POST[group]','$_POST[address1]','$_POST[address2]','$_POST[address3]',
'$_POST[email]','$_POST[city]','$_POST[state]','$_POST[zip]','$_POST[country]')" ;
Because you got some field names which is reserved keywords like for example you have group
Your $_POST values is missing quotes, Try updating them
$sql="INSERT INTO registration
(`username`,`password`,`fname`,`lname`,`group`,`address1`,`address2`,`address3`, `email`,`city`,`state`,`zip`,`country`)
VALUES
('$_POST[\"name\"]','$_POST[\"password\"]',$_POST[\"firstname\"]','$_POST[\"lastname\"]','
$_POST[\"group\"]','$_POST[\"address1\"]','$_POST[\"address2\"]','$_POST[\"address3\"]',
'$_POST[\"email\"]','$_POST[\"city\"]','$_POST[\"state\"]','$_POST[\"zip\"]','$_POST[\"country\"]'
)" ;
Well it is too late but this might help someone. Whenever you want to check why your query doesnt' work.. Always try to echo your query and paste it to the phpmyadmin and it will throw the mySQL error which are more easy to understand that what's the issue in query

how to arrange the checkboxes in 3/3 format on a layout of a form

Hi there. Can anyone please tell me how to arrange the list of checkboxes of cuisines label which is retrieved from the data base and when it is displaying it is not in the order coming side by side all together I want it to be displayed in a 3 by 3 format. Here is the code for that:
<div id="frmform">
<form name="frmrestaurant" id="frmrestaurant" method="post" onsubmit="" enctype="multipart/form-data">
<p class="msgsignup">Add Restaurant</p>
<div id="iderror"></div>
<div class="topinputs">
<div> <label for="restaurant_name" class="name">Restaurant Name :</label><input type="text" name="restaurant_name" size="32" id="restaurant_name" value="<?php echo $row->restaurant_name; ?>" class="validate[required,custom[onlyLetter],length[0,100]] text-input" /> </div>
</div>
<div> <label for="website" class="name">Website :</label><input size="32" type="text" name="website" id="website" value="<?php echo $row->website; ?>" class="validate[required,length[0,100]] text-input" /> </div>
<div> <label for="budget" class="name">Budget :</label>
<?php echo $this->lists['budget'];?>
</div>
<div> <label for="idcuisine" class="cuisine" >Cuisine:</label>
<?php echo $this->lists['cuisine'] ;?>
<div> <label for="idcategory" class="category">Category:</label>
<?php echo $this->lists['category'];?>
</div>
The lists of cuisine and category is not displaying properly.
Thanks.
It could be done with php right logic
<tr>
<?php
while($ofetch=$db->fetchNextObject($query))
{
$j++;
?>
<td width="33%">
<input type="checkbox" name="service[]" id="service" value="<?php echo $ofetch->service_id?>" /> some text
</td>
<?php if($j%3==0) { echo "</tr><tr>";}
}
?>
</tr>

Categories