This is a discussion on Using variables in login script: within the PHP Language forums, part of the PHP Programming Forums category; Hello, I wondered if anyone could advise? I am trying to write a basic script, which allows user's to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I wondered if anyone could advise? I am trying to write a basic script, which allows user's to enter there username, password in text fields. Then we take these values and pass them to the method login_user($userid, $password); I was unsure how to take the text fields values, and store them in variables, when the submit button is clicked? And report when the user could not be logged , or the textfields contain no values? Thank you <?php function login_form(){ global $PHP_SELF, $userid, $password; ?> <html> <head> <title></title> </head> <body> <div align="center"> <form method="post" enctype="multipart/form-data" action="<?php echo $PHP_SELF ?>"> <table border="1"> <tr> <th align="right">E-mail</th> <td nowrap> <input name="userid" size="25"> </td> </tr> <tr> <th align="right">Password</th> <td nowrap> <input name="password" size="25"> </td> </tr> <tr> <td align="center"> <input type="submit" name="submit" value="Login"> </td> </tr> </table> </form> <div> </body> </html> <?php } login_form(); $user_info = login_user($userid, $password); ?> |