Hey can anyone tell me why im getting the following undefined notice for the code straight after:
Notice: Undefined index: login in C:\xampp\htdocs\Care2Share\loginC2S.php on line 43
<?php
$form = "<form action='index.php?login=yes' method='POST'>
<table>
<tr>
<td><input type='text' id='usernamebox' name='user' tabindex='1' value='Username' class='textbox' onfocus='usernamebox_focus();' onblur='usernamebox_blur();'></td>
</tr>
<tr>
<td><input type='text' id='passwordbox' name='pass' tabindex='2' value='Password' class='textbox' onfocus='passwordbox_focus();' onblur='passwordbox_blur();' /></td>
<td><input type='submit' name='login' value='login' tabindex='3' class='button'> </td>
</tr>
</table>
</form>";
if ($_POST['login'])
{
}
else
{
echo "$form";
}
?>
I'm quite sure im collecting the text name 'login' from inside the definition of the variable $form. But im still getting that notice in the browser for the part of the code where im attempting to apply $_POST['login'] in the if statement condition.
Can anyone help? I am new to this so is probably a pretty straight forward solution.