I've just started learning PHP and have written a simple login form to link to a MySQL database. The database is configured and I am able to pull data back and display it to a webpage. However, when trying to capture the contents of the $_POST variable in order to get the username and password data posted from the form, I'm getting an "undefined index" error. No data is being passed through into the $_POST variable.
Having searched on hundreds of pages through Google, there are many offers of fixes for this however none of those suggested work for me.
The code which fails is...
Code: Select all
$username = $_POST['username'];
$password = $_POST['password'];
If any more code is needed (of which there is not much) then please let me know. There is only two input boxes and a submit button.
Thanks in advance for your help,
K