Im having a problem getting post variables from a form. Here is the form:
Expand|Select|Wrap|Line Numbers
- <a href='register_form.php'>Not a member?</a>
- <form method='post' action='member.php'>
- <table bgcolor='#cccccc'>
- <tr>
- <td colspan=2>Members log in here:</td>
- <tr>
- <td>Username:</td>
- <td><input type='text' name='username'></td></tr>
- <tr>
- <td>Password:</td>
- <td><input type='password' name='passwd'></td></tr>
- <tr>
- <td colspan=2 align='center'>
- <input type='submit' value='Log in'></td></tr>
- <tr>
- <td colspan=2><a href='forgot_form.php'>Forgot your password?</a></td>
- </tr>
- </table></form>
Here's the PHP fragment....
Expand|Select|Wrap|Line Numbers
- <?php
- //include function files for this application
- require_once('bookmark_fns.php');
- session_start();
- /* if (!isset($_POST['username'])) {
- echo "Uhoh, you need to fill out the whole form!";
- exit;
- }
- */
- //create short varible names
- $username = $_POST['username'];
- $passwd = $_POST['passwd'];
Notice: Undefined index: username in C:\wamp\www\Bobs\26\member.php on line 13
Notice: Undefined index: passwd in C:\wamp\www\Bobs\26\member.php on line 14
Oddly enough, apart from that the script runs perfectly! What am I doing wrong? Thanks!
PS On other forums it reccomends surpressing notices. Ive always thought that this is NOT the way forward! :D