php - get value of input element with "id" or "name" -


i trying learn php , have seen videos , tutorials, when creating session variables values going pulled out values entered in input elements, "id" of input element 1 matters while when checking if submit button clicked "name" of input element matters?

<?php  if (isset($_post['register'])) {  //register "name"     session_start();    $fname = $_post['first_name'];  //first_name "id"     ... } ?> <!doctype html> ... <form action="" method="post" name="registerform" id="registerform"> <input name="firstname" type="text" id="first_name">  ... <input name="register" type="submit" id="register" value="submit"> 

id , classes css or javascript purpose.use name getting post values $_post['firstname'].

<input name="firstname" type="text" id="first_name"> 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -