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
Post a Comment