murli800 Posted April 30, 2011 Share Posted April 30, 2011 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] Quote Link to comment https://forums.phpfreaks.com/topic/235160-not-getting-varible-value-by-post/ Share on other sites More sharing options...
wildteen88 Posted April 30, 2011 Share Posted April 30, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/235160-not-getting-varible-value-by-post/#findComment-1208600 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.