Jump to content

Multiple submittion on same page and value of both drop down list no change


Recommended Posts

<?php

 

 

$conn=mysql_connect("localhost","deepak","");

mysql_select_db("fgghghj");

 

function city()

{

$sql=mysql_query("select distinct city from magnatec where city not in(' ')");

while($row=mysql_fetch_array($sql))

{

print '<option>'.trim($row['city']).'</option>';

 

}

 

}

 

 

function dealer()

{

$sql=mysql_query("select distinct suburb_location from magnatec where city='$_POST[cit]' AND city not in(' ') AND suburb_location not in(' ')");

while($row=mysql_fetch_array($sql))

{

print '<option>'.$row['suburb_location'].'</option>';

 

}

}

 

function show()

{

$sql=mysql_query("select * from magnatec where suburb_location='$_POST[locat]' and suburb_location not in(' ')");

while($row=mysql_fetch_array($sql))

{

print '<td><span class="drbodytext">'.$row['dealer_name'].'</span></td>';

print '<td><span class="drbodytext">'.$row['contact_person'].'</span></td>';

print '<td><span class="drbodytext">'.$row['address'].'</span></td>';

print '<td><span class="drbodytext">'.$row['closest_landmark'].'</span></td>';

print '<td><span class="drbodytext">'.$row['direction_from_landmark'].'</span></td>';

print '<td><span class="drbodytext">'.$row['tel_no'].'</span></td></tr>';

}

 

}

 

 

?>

 

 

<html>

<head>

<title>CITY SEARCH</title>

<link rel="stylesheet" type="text/css" href="contentstyles.css">

</head>

 

<body>

<BR><BR>

<form name="two" method="POST" action="$_SERVER[php_SELF]">

  CITY:<select name="cit"><?php city();?>

</select> 

  <input type="submit" value="Location">

</form>

 

<BR> <form  name="one" method="post" action="$_SERVER[php_SELF]">

  LOCATION:<select name="locat"><?php dealer();?>

  </select>

<input type="submit" value="Details">

  </form><br><br>

<table border=0>

<tr class="bggreen">

  <th>DEALER NAME</th><th>CONTACT PERSON</th><th>ADDRESSES</th><th>CLOSEST LANDMARK</th><th>DIRECTION FROM LANDMARK</th><th>TEL. NO</th>

</tr>

<?php show(); ?>

</table>

  </body>

</html>

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.