Here's what I have so far:
First drop down = select a state (works)
This populates the second drop down (works)
Second drop down = select a city (works)
This populates the third drop down with local restaurant names (not quite)
When I select a restaurant from the drop down the form is submitted but the $rest_name variable isn't carried over
Site: www.abcgreatdeals.com
Select:California, La Quinta for an example
I'm sure it's something simple that I'm just over looking. Thanks for any input.
Code: [Select]<form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<?php
if (isset ($_POST['state']))
{
if ($state == '99')
{
?>
<script type="text/javascript">
<!--
window.location = "http://www.abcgreatdeals.com"
//-->
</script>
<?php
}
?>
<select name="state" CLASS="formTextbox" onchange="form1.submit();">
<option value="<?=$state;?>"><?=$state;?></option>
<option value="99">Start Over</option>
<?php
}
else{
$Get_State = mysql_query("SELECT DISTINCT state FROM coupons ORDER BY state",$db_link);
?>
<select name="state" CLASS="formTextbox" onchange="this.form.submit();">
<OPTION SELECTED VALUE="">Select A State</OPTION>
<? while($get_it = mysql_fetch_array($Get_State)) { ?>
<option value="<?=$get_it['state'];?>"><?=$get_it['state'];?></option>
<?
}}
if (isset ($_POST['state']))
{?>
</select>
</form>
<form id="form2" name="form2" method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<?php
if (isset ($_POST['city']) != '')
{
if ($city == '99')
{
?>
<script type="text/javascript">
<!--
window.location = "http://www.abcgreatdeals.com"
//-->
</script>
<?php
}
?>
<input type="hidden" name="state" value="<?="$state"; ?>">
<select name="city" CLASS="formTextbox" onchange="form2.submit();">
<option value="<?=$city;?>"><?=$city;?></option>
<option value="99">Start Over</option>
<?php
}
else{
$Got_City = mysql_query("SELECT DISTINCT city FROM coupons WHERE state='$state' ORDER BY city",$db_link);
?>
<input type="hidden" name="state" value="<?="$state"; ?>">
<select name="city" CLASS="formTextbox" onchange="form2.submit();">
<OPTION SELECTED VALUE="">Select A City</OPTION>
<? while($got_it = mysql_fetch_array($Got_City)) { ?>
<?
if ($got_it['city'] != ''){ ?>
<option value="<?=$got_it['city'];?>"><?=$got_it['city'];?></option>
<?
}
else { ?>
<option value="99">Start Over</option>
<? } ?>
<?
}}
if (isset ($_POST['city']))
{?>
</select>
</form>
<form id="form3" name="form3" method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<?php
if (isset ($_POST['rest']) != '')
{
if ($rest == '99')
{
?>
<script type="text/javascript">
<!--
window.location = "http://www.abcgreatdeals.com"
//-->
</script>
<?php
}
?>
<input type="hidden" name="city" value="<?="$city"; ?>">
<input type="hidden" name="state" value="<?="$state"; ?>">
<select name="rest" CLASS="formTextbox" onchange="form3.submit();">
<option value="<?=$rest_name;?>"><?=$rest_name?></option>
<option value="99">Start Over</option>
<?php
}
else{
$Get_Rest = mysql_query("SELECT DISTINCT rest_name FROM coupons WHERE state='$state' AND city='$city'",$db_link);
?>
<input type="hidden" name="state" value="<?=$state?>">
<input type="hidden" name="city" value="<?=$city?>">
<select name="rest" CLASS="formTextbox" onchange="form3.submit();">
<OPTION SELECTED VALUE="">Select A Restaurant</OPTION>
<?
while($got_rest = mysql_fetch_array($Get_Rest)){
$rest_name = stripslashes($got_rest['rest_name']);
?>
<option value="<?=$rest_name;?>"><?=$rest_name?></option>
<?
}}}}
if (isset ($_POST['rest']))
{?>
</select>
</form>
<?php
if ($rest_name){
echo "<strong>Click on coupons to print individually</strong>
";
}
if ($rest_name)
{
$Get_Coupons = mysql_query("SELECT * FROM coupons WHERE rest_name='$rest_name' ORDER BY coupon_rank DESC",$db_link);
How do i do multi uploads?.
Hey i would like to do this : http://hosting.mrkrabz.net/I've got the base down you can upload single files, But how would i make it so when you click a button it adds a new field for a file to be
Retreiving objects from Sessions
Hi all,I am getting really frustrated with storing and retreiving objects from a session. But it may be because of my lack of knowledge in sessions First some system specs:OS - Vista Home
upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please tell me how can i restrict that
PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in. Moderators: Please excuse me if this is in the wrong category.The problem is that I am assigned with the task of
Wrong Info sent Using $get in form
Hi i have this code that i tried to make to send some info from one page to aother with lots of ppls help and it works ok but when i have multiple files it doesnt send the correct info.What im tryin
Struct/union and scope problem!
HI all , I have
Help please - How to validate from 2 possible answers
Hi I hope somebody can help me with what will probably be really simple, I'm pulling my hair trying to get my head round it.I've got a contact form and I would like to add to it a couple of simple
Cron Job and Output
I have php codes running under a cron job.But everytime i output (echo) , it comes out as complete text:THe php script is setup to output some stuff so they are sent to the cron email...but all the
My query is being run with no results.
I have this.Code: function DropUser($duser_id, $user_email, $user_username) { if(isset($_SESSION['admin_username']) && isset($_SESSION['admin_id']) &&
How to get all server headers like Live http Headers does
Hey all, like many of you I use the Firefox addon "Live http Headers". I'm trying to write a tool that will basically do the same thing, but web-based... so the user would enter a URL and