<?php
include ("Includes/DB_config.php");
//Define dropdown menu
echo "<select name=\'ProjectName\'>\n";
echo "<option value=\"NULL\">Select your project</option>\n";
//Select data from the database
$result = mysql_query("SELECT ProjectID,ProjectName FROM tb_project");
//Fetch data & Populate dropdown menu
while($row=mysql_fetch_array($result))
{
$pjt_id = $row['ProjectID'];
$pjt_name = $row['ProjectName'];
echo "<option value=\"$pjt_id\">$pjt_name</option>\n";
}
echo "</select>";
?>
<a href="/www/gdis_sys_test/Project_Setup_Display.php?id=<?php echo $pjt_id ?>">Edit</a>
答案 0 :(得分:0)
您可以使用javascript来实现此目的。
<强> JAVASCRIPT 强>
function upperCase(x)
{
var e = document.getElementById("editButton");
e.href = "/www/gdis_sys_test/Project_Setup_Display.php?id=" + x;
}
<强> HTML 强>
<select onchange="upperCase(this.value)">
<option value="1">Value 1</option>
<option value="2">Value 2</option>
<option value="3">Value 3</option>
<option value="4">Value 4</option>
</select>
<a id="editButton" href="/www/gdis_sys_test/Project_Setup_Display.php?id=1">Edit</a>