Oops, my bad. Here you go:
/***** Code for the form ***/
<?php require_once('Connections/online.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "bizreg")) {
$insertSQL = sprintf("INSERT INTO bizsubmit (bizname, address1, address2, city, zip, country, phone, website, hours_start, hours_end, contact_name, email, pw, biztype, cuisine, gffoods, menulink1, menulink2, menulink3, comments) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['bizname'], "text"),
GetSQLValueString($_POST['address1'], "text"),
GetSQLValueString($_POST['address2'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['zip'], "text"),
GetSQLValueString($_POST['country'], "text"),
GetSQLValueString($_POST['phone'], "text"),
GetSQLValueString($_POST['website'], "text"),
GetSQLValueString($_POST['hours_start'], "text"),
GetSQLValueString($_POST['hours_end'], "text"),
GetSQLValueString($_POST['contact_name'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['pw'], "text"),
GetSQLValueString($_POST['business_type'], "text"),
GetSQLValueString($_POST['cuisine'], "text"),
GetSQLValueString($_POST['gffoods'], "text"),
GetSQLValueString($_POST['menulink1'], "text"),
GetSQLValueString($_POST['menulink2'], "text"),
GetSQLValueString($_POST['menulink3'], "text"),
GetSQLValueString($_POST['comments'], "text"));
mysql_select_db($database_local, $local);
$Result1 = mysql_query($insertSQL, $local) or die(mysql_error());
}
?>
<!DOCTYPE html>
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="GlutenWatchers" content="GlutenWatchers.com." />
<meta name="viewport" content="width=1024" />
<title>Register your business with GlutenWatchers</title>
<meta name="Category" content="gluten free living, apps, celiac" />
<meta name="Description" content="Register your gluten free store or restaurant with us." />
<link rel="stylesheet" href="styles/base.css" type="text/css" />
<link rel="stylesheet" href="styles/forms.css" type="text/css" />
<link rel="stylesheet" href="styles/gw1.css" type="text/css" />
<script src="
http://code.jquery.com/jquery-latest.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="
http://dev.jquery.com/view/trunk/plugin ... "></script>
<script type="text/javascript" src="scripts/jquery.form.js"></script>
<script type="text/javascript" src="
http://dev.jquery.com/view/trunk/plugin ... "></script>
<script type="text/javascript" src="customform.js"></script>
<script type="text/javascript">
jQuery.validator.setDefaults({
debug: true
});
</script>
<script type="text/javascript">
$(document).ready(function()
{
$("#bizreg").validate
({
rules: {
bizname: "required",
address1: "required",
city: "required",
zip: "required",
country: "required",
email:{required:true, email:true},
pw:"required",
business_type: "required",
cuisine: "required",
gffoods: "required",
terms: "required"
},
submitHandler: function(form) {
// do other stuff for a valid form
$.post('newbizregd.php', $("#bizreg").serialize(), function(data) {
$('#results').html(data);
});
}
});
});
</script>
</head>
<body id="specs">
<div id="productheader">
<h2><a href="
http://www.glutenwatchers.com" target="_new"><img src="img/logo2.png" alt="GlutenWatchers" /></a></h2>
</div>
<div id="main" class="content">
<div class="grid2cola" id="hero">
<div class="column first">
<h3>Tell Us About Your Gluten Free Business</h3>
<div class="categorylist grid2col rounded">
<!-- Output form results here -->
<ul class="column first"><form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="bizreg" id="bizreg" title="Business Registration">
<fieldset><legend>Business Info</legend>
<div class="form-row"> <span class="label"><label for="bizname">Business Name: *</label> </span>
<input name="bizname" type="text" class="input-text" id="bizname" /></div>
<div class="form-row"> <span class="label"> <label for="address1">Address 1:*</label> </span>
<input name="address1" type="text" class="input-text" id="address1" /></div>
<div class="form-row"> <span class="label"> <label for="address2">Address 2:</label> </span>
<input name="address2" type="text" class="input-text" id="address2" /></div>
<div class="form-row"> <span class="label"><label for="city">City: *</label></span>
<input name="city" type="text" class="input-text" id="city" /> </div>
<div class="form-row"> <span class="label"><label for="zip">Zip/Postal Code: *</label> </span>
<input name="zip" type="text" class="input-text" id="zip" /></div>
<div class="form-row"> <span class="label"><label for="country">Country: * </label></span><select id="country" name="country" title="Please select your country">
<option value="" ></option>
<option value="AR">Argentina</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="BS">Bahamas</option>
<option value="BE">Belgium</option>
<option value="BO">Bolivia</option>
<option value="BR">Brazil</option>
<option value="CA">Canada</option>
<option value="CH">Chile</option>
<option value="CN">China</option>
<option value="CO">Colombia</option>
<option value="CR">Costa Rica</option>
<option value="HR">Croatia</option>
<option value="CU">Cuba</option>
<option value="CZ">Czech, Rep.</option>
<option value="DK">Denmark</option>
<option value="DO">Dominican, Rep.</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="SV">El Salvador</option>
<option value="FI">Finland</option>
<option value="FR">France</option>
<option value="DE">Germany</option>
<option value="GR">Greece</option>
<option value="GT">Guatemala</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="IN">India</option>
<option value="IE">Ireland</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JM">Jamaica</option>
<option value="JP">Japan</option>
<option value="LU">Luxembourg</option>
<option value="MX">Mexico</option>
<option value="MA">Morocco</option>
<option value="NL">Netherlands</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NG">Nigeria</option>
<option value="NO">Norway</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="PR">Puerto Rico</option>
<option value="RU">Russia</option>
<option value="SA">Saudi Arabia</option>
<option value="ZA">South Africa</option>
<option value="ES">Spain</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="TW">Taiwan</option>
<option value="TR">Turkey</option>
<option value="UK">United Kingdom</option>
<option value="US">United States</option>
<option value="UY">Uruguay</option>
<option value="VE">Venezuela</option>
<option value="OT">Other...</option>
</select> </div>
<div class="form-row"> <span class="label"><label for="phone">Phone:</label> </span>
<input name="phone" type="text" class="input-text" id="phone" /></div>
<div class="form-row"> <span class="label"><label for="website">Website:</label></span>
<input name="website" type="text" class="input-text" id="website" /></div>
<div class="form-row"> <span class="label"><label for="hours">Hours Your Business Is Open:</label></span>
<select name="hours_start" size="1" id="hours_start" title="hours start">
<option value=""></option>
<option value="6AM">6AM</option>
<option value="7AM">7AM</option>
<option value="8AM">8AM</option>
<option value="9AM">9AM</option>
<option value="10AM">10AM</option>
<option value="11AM">11AM</option>
</select>
To
<select name="hours_end" size="1" id="hours_end" title="hours end">
<option value=""></option>
<option value="7PM">7PM</option>
<option value="8PM">8PM</option>
<option value="9PM">9PM</option>
<option value="10PM">10PM</option>
<option value="11PM">11PM</option>
<option value="midnight">Midnight & beyond</option>
</select></div>
</fieldset>
<fieldset><legend>Contact Info</legend>
<div class="form-row"> <span class="label"><label for="contact_name">Contact name:</label></span>
<input name="contact_name" type="text" class="input-text" id="contact_name" /></div>
<div class="form-row"> <span class="label"><label for="email">Email: *</label></span>
<input name="email" type="text" class="input-text" id="email" /></div>
<div class="form-row"> <span class="label"><label for="pw">Select A Password: *</label></span>
<input name="pw" type="password" class="input-text" id="pw" /></div>
<span class="notes">(This will enable you to update your menu & other details over time)</span></fieldset>
<fieldset><legend>Menu Info</legend>
<div class="form-row"> <span class="label"><label for="business_type">Which of the following best describes your business: *<p class="notes">(Select all that apply)</p></label></span>
<select name="business_type" size="5" multiple id="business_type" title="Select your type of business">
<option value="restaurant">Restaurant</option>
<option value="bar">Bar/Pub</option>
<option value="bakery">Bakery</option>
<option value="coffee">Coffee Shop</option>
<option value="fastfood">Fast food</option>
</select> </div>
<div class="form-row"> <span class="label"><label for="cuisine">Select the cuisine/s that you offer: *<p class="notes">(Select all that apply)</p> </label></span>
<select name="cuisine" size="7" multiple id="cuisine" title="Select the cuisine you offer">
<option value="italian">Italian</option>
<option value="german">German</option>
<option value="french">French</option>
<option value="greek">Greek</option>
<option value="chinese">Chinese</option>
<option value="japanese">Japanese</option>
<option value="indian">Indian</option>
<option value="italian">Italian</option>
<option value="thai">Thai</option>
<option value="vietnamese">Vietnamese</option>
<option value="mexican">Mexican</option>
<option value="lebanese">Lebanese</option>
<option value="mediterranean">Mediterranean</option>
<option value="american">American</option>
<option value="mideast">Middle Eastern</option>
<option value="cuban">Cuban</option>
<option value="spanish">Spanish</option>
<option value="portuguese">Portuguese</option>
<option value="caribbean">Caribbean</option>
<option value="brazilian">Brazilian</option>
<option value="cajun">Cajun & Creole</option>
</select></div>
<div class="form-row"> <span class="label"><label for="menulink">Upload your gluten free menu here (You can upload upto 3 files)</label></span>
<input type="file" name="menulink1" id="menulink1" title="menulink1" />
<input name="menulink2" type="file" id="menulink2" title="menulink2" />
<input name="menulink3" type="file" id="menulink3" title="menulink3" /></div>
<div class="form-row"> <span class="label"><label for="gffoods">Top 5 gluten free foods you offer: *<p class="notes">Separate with commas</p></label></span>
<input name="gffoods" type="text" class="input-text" id="gffoods" size="40" /></div>
<div class="form-row"> <span class="label"><label for="comments">Any other info:</label></span><textarea name="comments" cols="25" rows="3" title="comments"></textarea></div>
</fieldset>
<div class="form-row"><input name="terms" type="checkbox" id="terms" title="Please agree that you have read the terms of service" value="" /> I have read the <a href="
http://www.glutenwatchers.com/terms/" target="_new">Terms of Service</a></label></div>
<div id="results"></div>
<input type="submit" value="Submit" />
<input type="hidden" name="MM_insert" value="bizreg">
</form>
</ul>
</div>
</div><!--/column first-->
<div class="column last">
<img src="img/ratatouille.jpg" width="172" height="130" alt="gluten free yummy dish">
<h4>Let us hear about the great gluten free goodies you offer</h4>
<ul class="circle">
<li>You can use this form to tell us about all that you offer for celiacs & other gluten free eaters.</li>
<li>Upload your gluten free menus</li>
<li>Tell us about your specials</li>
<li>Keep this information updated</li>
</ul>
</div><!--/column last-->
</div><!--/grid2col-->
<div class="grid2cola box rounded" id="sys-reqs">
<h2>About GlutenWatchers</h2>
<div class="column first">
<h3>Complete, Reliable information for celiacs is our goal</h3>
<div class="grid2col">
<div class="column first">
<h4>Towards this, we aim to</h4>
<ul class="circle">
<li>Arm fellow celiacs with authentic & accurate information about how to stay gluten free wherever they may be</li>
<li>Where to eat out safely, & what's available</li>
<li>What are gluten free products on the market</li>
<li>How to cook gluten free foods at home</li>
<li>Peer ratings & reviews</li>
</ul>
</div><!--/column first-->
<div class="column last">
<h4>What is Gluten Free food:</h4>
<ul class="circle">
<li>Foods that contain NO trace of wheat, barley, rye & a host of other grains; see <a href="
http://en.wikipedia.org/wiki/Gluten-free" target="_blank">Gluten free entry on Wikipedia</a> </li>
<li>Did you know that cross-contamination in the kitchen can lead to several miserable days for a celiac? Make sure that you do not use ladles, pots, fats & oils & other stuff that you may have used for regular cooking. Even small amounts of gluten can be very risky for the gluten free eater.</li>
<li>Did you know that many celiacs and gluten free eaters avoid corn, soy, yeast, sugar, dairy? Make sure to let the world know if you are cooking gluten free and also without these pesky ingredients. Celiacs will love you for it.</li></ul>
</div><!--/column last-->
</div><!--/grid2col-->
</div><!--/column first--><!--/column last-->
</div><!--/grid2col-->
<div class="below">
<p>Copyright © 2010 GlutenWatchers.com. All rights reserved.</p>
<ul class="piped">
<li><a href="
http://www.glutenwatchers.com/terms/" class="first" target="_blank">Terms of Use</a></li>
<li><a href="
http://www.glutenwatchers.com/privacy/" target="_blank">Privacy Policy</a></li>
<li><a href="mailto:
editor@glutenwatchers.com">Email Us</a></li>
</ul>
</div>
</div><!--/globalfooter-->
</body>
</html>
--------------------------------------------
/** Code for the mysql connection in online.php **/
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_local = "
http://mysql.glutenwatchers.com";
$database_local = "celiacapp";
$username_local = "xxxxxxx"; // obscured
$password_local = "xxxxxxxx"; // obscured
$local = mysql_pconnect($hostname_local, $username_local, $password_local) or trigger_error(mysql_error(),E_USER_ERROR);
?>
Thanks.