[CODE]index.php
<!DOCTYPE html>
<!–
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
–>
<html>
<head>
<title>Main Page</title>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<script>
function getddl1v()
{
var a=document.getElementById(“dbase”).value;
// alert(a);
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(“txtHint”).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open(“GET”,”getddl2v.php?q=”+a,true);
xmlhttp.send();
}
function showtables()
{
var a=document.getElementById(“dbase”).value;
// alert(a);
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(“txtHint”).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open(“GET”,”getddl2v.php?q=”+a,true);
xmlhttp.send();
}
</script>
</head>
<body onload=”getddl1v()”>
<form name=”f1″ action=”wel.php” method=”post” target=”_blank”>
<select id=”dbase” name=”dbase” onchange=”showtables()”>
<?php
$link = mysqli_connect(‘localhost’, ‘root’, ‘cutiepie_100′,’people’)
or die(“Could not connect database”);
$result=mysqli_query($link, “show databases”);
while($row= mysqli_fetch_array($result))
{
echo “<option value='”. $row[‘Database’]. “‘/>” . $row[‘Database’] . “</option>”;
}
?>
</select>
<div id=”txtHint”></div>
<textarea name=”skills” placeholder=”skill or item or spec”>java</textarea>
<textarea name=”city” placeholder=”city”></textarea>
<textarea name=”region” placeholder=”region”></textarea>
<textarea name=”country” placeholder=”country”></textarea>
<input type=”text” name=”lat” placeholder=”Latitude in degrees”>
<input type=”text” name=”long” placeholder=”Longitude in degrees”>
<input type=”text” name=”dist” placeholder=”Distance”><br>
<input type=”text” name=”file” placeholder=”Genearted filename”>
<input type=”submit” value=”(1) Show Results” name=”results”>
<input type=”submit” value=”(2) Update Table” name=”update”>
<input type=”submit” value=”(3) Make E-mail CSV” name=”csv”>
<input type=”submit” value=”(3) Make Phone Number CSV” name=”phone”>
<input type=”submit” value=”Get person Info with Deposit<Bid” name=”less”>
</form>
<form action=”wel.php” target=”_blank” method=”post”>
<input type=”text” placeholder=”Database” name=”db1″ value=”people”>
<input type=”text” name=”table1″ placeholder=”Table containing person data”>
<input type=”text” placeholder=”Sno” name=”sno”>
<input type=”text” name=”amount” placeholder=”Deposit amount”>
<input type=”submit” value=”Make Deposit” name=”deposit”>
</form>
</body>
</html>
[CODE]getddl2v.php
<?php
$q=$_GET[‘q’];
//echo $q;
$con=mysqli_connect(“localhost”,”root”,”cutiepie_100″,$q);
if (mysqli_connect_errno())
{
echo “Failed to connect to MySQL: ” . mysqli_connect_error();
}
$abc=mysqli_query($con,”use $q”) or die(‘cannot show tables’);
$result=mysqli_query($con,”show tables”);
echo “<select>”;
while($row= mysqli_fetch_array($result))
{
echo “<option value='”. $row[0]. “‘/>” . $row[0] . “</option>”;
}
echo “</select>”;
?>
i have these codes……the selection from select “dbase” changes value of div select using ajax…
but now i want to post both selected values to someother php script…first “dbase” is within form tags but difficult to get second dropdown list in div because name attribute of div tag doesnot exist..please tell how can i get both values