help with an update script
Posted: Tue Aug 15, 2006 2:17 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi i am very new to PHP and think that this may be a case of trying to run before i can walk.
What i am trying to do is create a form that allows me to update a users details, sound easy enough i know.
The way that i am doing this is by using a dynamic drop down menu containing the users first and last names to select the user i want to update.
on clicking the 'submit' button what i want to happen is to pass the id of the user that i have selected to a form where the rest of that users details will be populated from the database, i can then change and update the details.
So far i have managed to write the script for selecting the user, but i am having trouble with passing the users id onto the next form.
I have posted what i have done so far bellow.
If anyone can help it would be much appreciated as i think i might go mad soonCode: Select all
<? include ('connect.php');?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<? $query="SELECT user_id, user_firstname, user_lastname FROM share_users";
$result = mysql_query ($query);
?>
<form name='user_select' method='post' action='update_user1.php'>
<select name=user value=''>user</option>
<? while($nt=mysql_fetch_array($result))
{
echo "<option value=$nt[user_id]>$nt[user_firstname] $nt[user_lastname]</option>";
}
?>
</select>
<br>
<br>
<input type='submit' name='submit' value='submit'>
</form>
</body>
</html>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]