473,378 Members | 1,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

combobox problems

rohitrohitrohit
new to php.....

i hav a login page? after validaing loginname and password second page comes...... i access his loginname through url which is ->http://localhost/aa/vtr/add/add_ps2.php?name=div,in second page i hav three combobox (unit,achivements,crop) these comboxbox dynamically fill values from mysql database depends on loginname but when i am selecting unit comboxbox value browser url changed to http://localhost/aa/vtr/add/add_ps2.php because of this other controls in my form show nothing or null.
from rohit
Sep 23 '08 #1
3 1953
MarkoKlacar
296 Expert 100+
Hey mate,

Can you upload some code?

/MK
Sep 23 '08 #2
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.
Sep 24 '08 #3
Hi,

On the page where you have your combobox, is that all the code for that page? What does 'sel()' do?

I would recommend that if want to fill the values of the other combobox, use an AJAX script or POST the data into the same page.

Cheers
Sep 24 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Steve | last post by:
I have an unbound combobox in the form header of a continuous form. The selection in the combobox sets the where clause in a querydef which determines QryPFrmInventoryManagement. The following code...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
2
by: John Tyce | last post by:
When a button is clicked, a date is inserted or added into a combo box like this : ComboBox.Items.Add(string) or ComboBox.Items.Insert(0,string); Either way, the new string does not show up in the...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
2
by: SKarnis | last post by:
We are trying to rebuild a current Access 2002 (XP) mdb program to VB.NET with a SQL database - we are having problems with a suitable combobox. There are many threads discussing multiple column...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
0
by: Frnak McKenney | last post by:
Can I use a bound ComboBox for both browsing and editing? I'm working on a small, standalone database application using Visual C#.NET 2003 and an Access data file. In order to keep the number...
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to create a customized ComboBox where the methods ComboBox.Items.Add and ComboBox.Items.Insert will behave thusly: -- If the item is not present, add it. -- If the item is present, set the...
2
by: graywolf | last post by:
Hi there, I have just started using Access 2003 in the last couple of months and have a couple of problems i would like some help with please for a project i am working on. PROBLEM 1. I have a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.