I added three extra questions to a form that was working (ie posting to the database and validating). Since I added the 3 new questions nothing posts. Can anyone see what's wrong? Thanks.
ps the new form fields are highlighted in red below. Thanks a lot!
<?php
include("session_functions.inc");
if(validate_session() && $SESSION['userType']==1 )
{
if(!isset($POST['submit']))
{
?>
<!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" xml:lang="en" lang="en">
<head>
<title> Jobs4Bobs.com | Home </title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<!--<div class="login">
<a href="login.php">Log In</a>
</div> login-->
<div id="content">
<br/>
<br/>
<br/>
<form name="myform" action="<?$PHP_SELF?>" method="post"onsubmit="return validate();">
<table class = "center">
<h1>Enter Job Details: Step 2</h1>
<tr> <td class = "green">Trade</td><td><select size = "1" name = "trade">
<option value = "Other">Other</option>
<option value = "None">None</option>
<option value = "Agricultural Contractors">Agricultural Contractors</option>
<option value = "Architects">Architects </option>
<option value = "Builder">Builder </option>
<option value = "Carpenter ">Carpenter </option>
<option value = "Decking Specialists">Decking Specialists</option>
<option value = "Electrician">Electrician</option>
<option value = "Flooring">Flooring</option>
<option value = "Gas fitters">Gas fitters </option>
<option value = "Heating">Heating </option>
<option value = "Gardening and Gardeners">Gardening and Gardeners </option>
<option value = "Landscaping">Landscaping</option>
<option value = "Kitchen Specialist">Kitchen Specialist</option>
<option value = "Painters">Painters</option>
<option value = "Plasterer">Plasterer</option>
<option value = "Plumber">Plumber </option>
<option value = "Tiling">Tiling</option>
</select></td></tr>
<tr><td class="green"> Job Title<td><input type = "text" size = "26" name = "title" /></td></td></tr>
<tr><td><br /></td></tr>
<tr><td></td><td colspan="1" class = "blue">Please provide us with a short description of your project, including any fittings that you require,
area measurements etc., in the job description box below.</td></tr>
<tr><td class="green">Job Description</td><td><textarea name = "description" rows = "5" cols = "20" /></textarea></td></td></tr>
<tr> <td class = "green">Area</td><td><select size = "1" width="10" name = "area">
<option value = "Carlow">Carlow</option>
<option value = "Cavan">Cavan</option>
<option value = "Clare">Clare</option>
<option value = "Cork City">Cork City</option>
<option value = "Cork County East">Cork County East</option>
<option value = "Cork County North">Cork County North</option>
<option value = "Cork County South">Cork County South</option>
<option value = "Cork County West">Cork County West</option>
<option value = "Donegal">Donegal</option>
<option value = "Dublin City North">Dublin City North</option>
<option value = "Dublin City North">Dublin City South</option>
<option value = "Dublin County">Dublin County</option>
<option value = "Galway City">Galway City</option>
<option value = "Galway County">Galway County</option>
<option value = "Kerry">Kerry</option>
<option value = "Kildare">Kildare</option>
<option value = "Kilkenny">Kilkenny</option>
<option value = "Laois">Laois</option>
<option value = "Leitrim">Leitrim</option>
<option value = "Limerick">Limerick</option>
<option value = "Longford">Longford</option>
<option value = "Louth">Louth</option>
<option value = "Tipperary North">Tipperary North</option>
<option value = "Tipperary South">Tipperary South</option>
<option value = "Mayo">Mayo</option>
<option value = "Meath">Meath</option>
<option value = "Monaghan">Monaghan</option>
<option value = "Offaly">Offaly</option>
<option value = "Roscommon">Roscommon</option>
<option value = "Sligo">Sligo</option>
<option value = "Waterford">Waterford</option>
<option value = "Westmeath">Westmeath</option>
<option value = "Wexford">Wexford</option>
<option value = "Wicklow">Wicklow</option>
</select></td> </tr>
<tr> <td class="green">Job Price* (in euros)</td><td><input type = "text" size = "26" name = "price" /></td> </tr>
<tr> <td class="green">Start Date</td><td><select size = "1" name = "date">
<option value="Immediate Start">Immediate Start</option>
<option value="Flexible">Flexible</option>
<option value="1-2 weeks">1-2 weeks</option>
<option value="2-4 weeks">2-4 weeks</option>
<option value="1-2 months">1-2 months</option>
<option value="2-4 months">2-4 months</option>
<option value="4-6 months">4-6 months</option>
<option value="6+ months">6+ months</option>
</select></td></tr>
<tr><td>*This is a guideline price</td></tr>
[COLOR="red"]
<tr> <td>Please enter total project area measurement (i.e. total counter space/floor space) in square metres:</td>
<td><input name="sqmeters" type="text" size="20" /></td></tr>
<tr><td>Please select type of tile you wish to use:</td><td><select name="tiletype">
<option value="Glazed ceramic tile">Glazed ceramic tile</option>
<option value="Porcelain">Porcelain</option>
<option value="Pregrouted tile">Pregrouted tile</option>
<option value="Terracotta">Terracotta</option>
<option value="other">Other</option>
</select></td></tr>
<tr><td>Please select the the location of your tiling job (e.g. floor, wall, counter top etc.):</td></tr>
<tr><td><textarea rows="5" cols="20" name = "tilelocation"></textarea></td></tr>[/COLOR]
</table>
<input type = "submit" name = "submit" value = "Submit">
</form>
</div> <!--end of content div-->
<div id = "footerlinks">
<div id = "footerleft">
<h1>Call Us Today</h1>
<table class = "center" cellpadding = "2"> <tr> <td> <a href="contact.php">
<IMG border = "0" SRC="images/telephone.jpg" height = "60" width = "60" ALT="telephone"> </a> </td> <td><h2> +353 21 7331 230 </h2>
</td>
<tr> <td>
<a href="contact.php">
<IMG border = "0" SRC="images/skype.png" height = "60" width = "60"ALT="skype"> </a> </td> <td><h2>Skype us </h2>
</td> </tr>
</table>
</div>
<div id = "footercenter">
<h1> Keep In Touch</h1><table class = "center"> <tr><td><a href="contact.html"><IMG border = "0"SRC="images/twitter.png" height = "50" width = "50"ALT="one"></a></td>
<td> <a href="contact.html"><IMG border = "0" SRC="images/linkedin.png" height = "60" width = "60"ALT="one"></a> </td>
<td> <a href="contact.html"><IMG border = "0" SRC="images/youtube.png" height = "60" width = "60"ALT="one"></a> </td>
<td> <a href="contact.html"><IMG border = "0" SRC="images/facebook.png" height = "60" width = "60"ALT="facebook"></a> </td>
</tr>
<tr> <td> Twitter</td>
<td> Linked In</td>
<td> You Tube </td>
<td> Facebook </td>
</tr>
</table>
</div>
<div id = "footerright">
</div>
</div>
</div><!--CONTAINER-->
</body>
</html>
<?php
}
else
{
$db = mysql_connect("") or die(mysql_error());
mysql_select_db("", $db);
$title = $_POST['title'];
$desc = $_POST['description'];
$area = $_POST['area'];
$date = $_POST['date'];
$price = $_POST['price'];
$trade = $_POST['trade'];
$Tiletype = $_POST['tiletype'];
$Tilelocation = $_POST['tilelocation'];
$Sqmeters = $_POST['sqmeters'];
$id = $_SESSION["userID"];
$status = true;
if($date == "")
{
$status = false;
$url = "Location: add_job.php?date";
header($url);
}
if($price == "" )
{
$status = false;
$url = "Location: add_job.php?price";
header($url);
}
if (!is_numeric($price))
{
$status = false;
$url = "Location: add_job.php?price1";
header($url);
}
if($area == "")
{
$status = false;
$url = "Location: add_job.php?area";
header($url);
}
if($trade == "")
{
$status = false;
$url = "Location: add_job.php?trade";
header($url);
}
if($desc == "")
{
$status = false;
$url = "Location: add_job.php?desc";
header($url);
}
if($title == "")
{
$status = false;
$url = "Location: add_job.php?title";
header($url);
}
if($status == true)
{
$query = mysql_query("insert into jobs
(buyer_id, description, trade, price, date, area, title, titletype, tilelocation, sqmeters)
values
('$id','$desc','$trade', '$price', '$date', '$area' , '$title', '$Tiletype', '$Tilelocation', '$Sqmeters')");
$url = "Location: buyer_home.php?jobadd";
header($url);
}
}
}
else
{
$url = "Location: login.php?error1";
header($url);
}