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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -