| re: combobox problems
loginpage code->
<form........>
<input name="txtusername" id="txtusername" type="text" width="70px" class="style23"/>
<input name="txtpass" type="password" width="70px" class="style23"/>
button here...................
</form>
i made a mid page for validating user code is below---
<?php
$divname=$_POST['txtusername'];
$pass=$_POST['txtpass'];
include("../dbcon.php");
$dbcon1=new Dbcon();
$host=$dbcon1->host;
$user=$dbcon1->user;
$pass1=$dbcon1->pass;
$db=$dbcon1->db;
mysql_connect($host,$user,$pass1) or die("could not connect:".mysql_error());
mysql_select_db($db);
$query="select UserName,Password FROM user where UserName='$divname' and Password='$pass'";
$result = mysql_query($query);
if($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
header("Location: homepage.php?name=$divname");
}
else
{
......
}
?>
after validating... second page come in this page i made some combobox. ----
<?php
$division=$_GET['name'];
$res = mysql_query("SELECT distinct untcode FROM div_gp where division='$division'")or die("Invalid query: " . mysql_query());
echo '<select class="style23" id="unt" name="unt" onchange="sel()">';
echo '<option value="">Select..</option>';
while ($row = mysql_fetch_array($res))
{
$va1 = $row['untcode'];
if(isset($_POST['unt']) )
{
if($va1==$_POST['unt'])
{
echo "<option value='$va1' selected>$va1</option>";
}
else
{
echo "<option value='$va1'>$va1</option>";
}
}
else
{
echo "<option value='$va1'>$va1</option>";
}
}
echo '</select>';
?>
onchange this combobox value corresponding value fill to other combobox but browers url changes.is there anyway when in mypage whenever i change comboxbox value my browser url did not effected.
|