Forms | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Forms

In the example of from requesting username and password, what is the use of name="username" and name="password" options?

6th Aug 2017, 2:33 PM
Keerthi Reddy
1 Answer
+ 1
When it comes to the time when you need to collect the data from the form, you will need the "name" attributes values to actually collect the data from the form. In your example above, if I want to get those details from your form then I'll use: $uname = $_POST['username']; $pword = $_POST['password']; This will get those details from the form and store it in those variables.
6th Aug 2017, 2:48 PM
Ghauth Christians
Ghauth Christians - avatar