I’m not really have a link because it still in test mode. The form is not in the index page it is in this "menu page" here:
<?php
$now = strtotime(date("d/m/Y H:i:s"));
$TABLES = "contacts c,coupons co,businesses b, users u,states, cats,countries";
$COND = "b.business=c.business and c.county=countries.abbr and b.business=co.business and co.approved=1 and c.pri_contact<>2";
/*
$COND.= " and u.user=b.user and u.billing=1 and u.expire>'$now' and cats.cat=b.cat";
*/
$COND.= " and u.user=b.user and u.billing=1 and u.expire>'$now' and cats.cat=co.cat";
if ($cfg['menu_style']=='button') {
$menu = $_GET ["menu"];
//$g_state = $cfg["g_state"];
//state
/* if ($menu=="mnu_state") {
$sql = "SELECT *, st_name as state_nm, c.state as state FROM $TABLES where $COND group by c.state order by c.state";
$pgnm="States";
$val1="state";
$nxt = "mnu_city";
}
//city
if ($menu=="mnu_city") {
$state = $_GET ["state"];
$_SESSION ["mnu_state"] = $state;
$sql = "SELECT *, count(*) as count FROM $TABLES where c.state='$state' and $COND group by c.city order by c.city";
$pgnm="Cities";
$val1="city";
$nxt = "mnu_cat";
}c.county
*/
//browse by country
if ($menu=="") {
$sql = "SELECT *, co_name as country_nm, c.county as country FROM $TABLES where $COND group by c.county order by c.county";
echo "SQLSTATEMENT:".$sql;
$pgnm="Countries";
$vall="country";
$nxt = "mnu_state";
}
//state
if ($menu=="mnu_state") {
$country = $_GET["country"];
$_SESSION["mnu_country"] = $country;
$sql = "SELECT *, count(*) as count FROM $TABLES where c.county='$country' and $COND group by c.state order by c.state";
$pgnm="States";
$val1="state";
$nxt = "mnu_city";
}
//city
if ($menu=="mnu_city") {
$state = $_GET ["state"];
$_SESSION ["mnu_state"] = $state;
$sql = "SELECT *, count(*) as count FROM $TABLES where c.state='$state' and c.county='$country' and $COND group by c.city order by c.city";
$pgnm="Cities";
$val1="city";
$nxt = "mnu_cat";
}
if ($menu=="mnu_cat") {
$city = $_GET ["city"];
$city = str_replace ("_", " ", $city);
$_SESSION ["mnu_city"] = $city; $state = $_SESSION ["mnu_state"];$country = $_SESSION["mnu_country"];
$sql = "select *, count(*) as count from $TABLES where c.city='$city' and c.state='$state' and c.county='$country' and $COND group by cats.category order by cats.category";
$pgnm="Categories";
$val1="cat";
$nxt = "mnu_bus";
}
if ($menu=="mnu_bus") {
$cat = $_GET ["cat"];
$_SESSION ["mnu_cat"] = $cat;
$city = $_SESSION ["mnu_city"]; $state = $_SESSION ["mnu_state"];$country = $_SESSION["mnu_country"];
$sql = "select * from $TABLES where b.cat=$cat and c.city='$city' and c.state='$state' and c.county='$country' and $COND group by b.name order by b.name";
$pgnm="Businesses";// in " . ucwords($city);
$val1="business";
$nxt = "mnu_bus";
}
}
include ("menuh.html");
if ($cfg['menu_style']=='button') {
//start style from stylesheet
echo "<div id='navcontainera'>";
echo "<ul id='navlista'>";
//Cycle through query set above
db_connect ($cfg["db_server"], $cfg["db_user"], $cfg["db_pass"], $cfg["db_database"]);
$result = db_query ($sql);
while ($row=mysql_fetch_object($result)) {
$id = $row->$val1;
//If it gets down to Cats you gotta pull the name from a 3rd table
if ($menu=="mnu_cat") {
$cats[] = $row->cat; //throw cats in array
}
if ($menu=="mnu_bus") {
$name = $row->name;
echo "<li><a href=index.php?menu=$nxt&cat=$cat&page=viewbus&bus=$id> $name </a></li>";
}
if ($menu!="mnu_bus" && $menu!="mnu_cat"){
$id1 = str_replace (" ", "_", $id);
$id = ucwords ($id);
if ($val1=="state") {
$id=ucwords ($row->state_nm);
}
echo "<li><a href=index.php?menu=$nxt&$val1=$id1> $id </a></li>"; //if its not a cat, just print it
}
}
mysql_close();
//Pull cats and show links to businesses of this cat in chosen state/city
if ($menu=='mnu_cat') {
foreach ($cats as $cat) {
db_connect ($cfg["db_server"], $cfg["db_user"], $cfg["db_pass"], $cfg["db_database"]);
$sql = "select * from cats where cat='$cat'";
$result = db_query ($sql);
while ($row=mysql_fetch_object($result)) {
$name = $row->category;
}
mysql_close();
echo "<li><a href=index.php?menu=$nxt&$val1=$cat> $name </a></li>";
}
}
//end stylesheet
echo "</ul>";
echo "</div>";
}
//drop down style ajaxified
if ($cfg['menu_style']=="dropdown") {
echo "<div id='load_div' style='display:none'></div>";
echo "<div style='border:solid 0px;position:relative;top:-30px;margin-left:15px'>";
echo "\n<script type='text/javascript' src='loadmenus.js'></script>\n";
echo "<form name='prod' id='select_form' method='post' action='' style='display:inline'>";
//country selector
echo " <br />";
echo "<select name='country' id='country' onkeyup='load_states(this.value)' onChange='load_states(this.value)'><option value=none selected>Vælg land</option>";
db_connect ($cfg["db_server"], $cfg["db_user"], $cfg["db_pass"], $cfg["db_database"]);
$sql = "SELECT *, co_name as country_nm, c.county as country FROM $TABLES where $COND group by c.county order by c.county";
$result = db_query ($sql);
while ($row=mysql_fetch_object($result)) {
$id = $row->abbr;
$name = $row->co_name;
echo "<option value='$id'>".ucfirst($name)."</option>";
}
echo "</select><br />";
//state selector
echo " <br />";
echo "<select name='state' id='state' onChange='load_cities(this.value)'>";
echo "<option value=none>Vælg region</option>";
echo "</select><br />";
//city selector
echo " <br />";
echo "<select id='city' name='city' onChange='load_cats(this.value)'>";
echo "<option value=none>Vælg by</option>";
echo "</select><br />";
//cat selector
echo " <br />";
echo "<select id='cat' name='cat' onChange='load_comps(this.value)'>";
echo "<option value=none>Vælg kategori</option>";
echo "</select><br /> ";
//company selector
echo " <br />";
echo "<select id='comp' name='comp' onChange='gotopage(this.value)'>";
echo "<option value=none>Vælg virksomhed</option>";
echo "</select>";
echo "</form>";
echo "</div>";
}
include ("menuf1.html");
//search
echo "<script language=\"javascript\">function clearinputText() { document.search.search.value= \"\"; }</script>";
echo "<form name='search' id='select_search' method='post' action='index.php?page=search'>";
echo " <b>- eller -    </b><br /><br /> ";
echo "<input type='text' name='search' value='' onfocus='clearinputText();'>";
echo "</form>";
//echo "  ";
//echo "<input type=submit value='search'>";//</form>";
//echo "<a href=index.php?page=advsearch>Avanceret</a>";
include ("menuf2.html");
?>
MOD EDIT: When posting PHP code, please use the board's [noparse]
..
[/noparse] bbcode tags as they make your code much easier to read and analyze.