Jump to content

not getting varible value by post


murli800

Recommended Posts

i am trying to create a code in which person has to login and then had to register his/her entry and exit timings...but my problem is that when i click $username is not accessible in if condition it gives....

 

 

Notice: Undefined index: username in C:\wamp\www\myproject\public\newatt\attendance.php on line 8

 

Notice: Undefined index: pwd in C:\wamp\www\myproject\public\newatt\attendance.php on line 9

Hi

i am in andar30/04/2011 05:49

 

 

i am accepting username by post and feeding it to variable in $username..help me

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/235160-not-getting-varible-value-by-post/
Share on other sites

This is because you need to check if these variables are set before using them

if(isset($_GET['username']) && isset($_GET['pwd']))
{
     // your code here for authenticating the user
}
else
{
     // display login form here
}

 

having the username/password within the url is insecure. You should be submitting your form with the post method.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.