faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

73 of 172 people (42%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How can I access data entered into a form by the user?
When i update a variable with a drop-down menu, it adds its value tothe database instead of replacin

Jun 11th, 1999 07:00
Nathan Wallace, Joao Monteiro, Nathan Wallace, Adam Trachtenberg


Each input in a HTML form has a name.  For example:

<input type=text name=user_name>

When PHP receives the form submission from the browser it automatically
creates variables which hold the form data.  In this example, a global
variable called $user_name would be available to your form handling
script.

Your user name is <?php echo $username ?>.