can anyone give me idea how to execute this?
Thanks.
What are you trying to do? A jump menu?
yup but the value of the option is on the table…
is this applicable using while…for the option value?
example:
i have a table for a user.
the value that in the user is called using a
while loop.
$user=mssql_query("Select * from tblUser");
echo "<select>";
while($row=mssql_fetch_assoc($user)){
echo "<option value='manage.php'>$row['username']</option>";
}echo "</select>";
how can i incorporate it. i tried it but it is not working.
Questions on the code you just posted:
$user=mssql_query("Select * from tblUser");
echo "<select>": // <- colon should be semi-colon
while( $row = mssql_fetch_assoc($user) ) {
echo "<option value='manage.php'>$row['username']</option>";
}</select> // Shouldn't this be echo "</select>;
yup i edit it…same error…
is there any way.
Is this what you are trying to do?
Note: This is a very quick guess
<?php
if( isset($_POST['userEdit']) ) {
header('Location: '.$_POST['userEdit']);
}
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
if( isset($_GET['user']) ) {
echo 'Editing '.ucfirst($_GET['user']).'\\'s information';
}
?>
<form method="post" action="test.php">
<?php
$array = array(
'Adam',
'Barbara',
'Catherine',
'Douglas'
);
echo '<select name="userEdit">';
foreach( $array as $user ) {
echo '<option value="test.php?user='.strtolower($user).'">'.$user.'</option>';
}
echo '</select>';
?>
<input type="submit" value="Submit">
</form>
</body>
</html>