HELP!!! Keep getting problem with undefined index....
Posted: Wed Aug 24, 2011 5:49 pm
I really dont get it now i keep having this problem and there always seems to be a different solutiion. Im defining variables and yet its telling me that they arent defined; so confusing :s
Does anyone know what the problem seems to be this time?
I know coding can be frustrating at times but im seeing myself not having any hair left the way this is going lol
Does anyone know what the problem seems to be this time?
Notice: Undefined index: user in C:\xampp\htdocs\Care2Share\design\status.php on line 4
Notice: Undefined index: id in C:\xampp\htdocs\Care2Share\design\status.php on line 5
Code: Select all
<?php
$username = $_SESSION['user'];
$userid = $_SESSION['id'] ;
if ($username)
{
echo "You are logged in as $username";
}
else
{
echo "<form action='loginC2S.php' method='POST' >
<table style='margin-left: auto; margin-right: auto;'>
<tr>
<td><input type='text' id='usernamebox' name='user' tabindex='1' value='Username' class='textbox' onfocus='usernamebox_focus();' onblur='usernamebox_blur();'></td>
<td><a href='register.php'>Register</a></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>";
}
?>