php - When I successfully login an extra function.session-start is displaying and how to check session for sign-in-action page -


I have a sign-in-action form page that accepts usernames and passwords through sign-in form. Now most things are working just like sign-out, if I lose the back button logout display and session but I am experiencing a very strange problem when I login and if the login is successful then one The link function.session-start is shown on this page. I have not done any such code, I do not know where this link came from, but it is disturbing my page. What is this error and how do I delete it? The second thing is that there is no way to check the session for this page. I know there will be, but listen, we are starting the session and while specifying the charge for the session, our usernames and passwords are valid and if I am checking on the onload event for this page then it will be logged out because Onload I have not started a session like this. I do not know much about it but I think I have described my problem.

  Sign-in-action form. Php  

  $ con = mysql_connect ("localhost", "root", ""); If (! $ Con) {dead ('Can not connect:' Mysql_error ()); } Mysql_select_db ("tcs", $ con); $ Usr = $ _ post ["username"]; // Choose the username from the login page $ pwd = hash ('sha1', $ _ POST ['password']); // Choose the password from the login page and use the hash algorithm to encrypt it $ cquery = "select from the employee" where the user name = '$ usr' and password = '$ pwd' "; Found in both rows in a single line of // serch $ result = mysql_query ($ query, $ con); If ($ result) {$ row = mysql_fetch_array ($ result); If (($ line ["user name"] == $ USR) and ($ line ["password"] == $ pwd)) {session_start (); $ _SESSION ['employee'] ['id'] = $ line ['user id']; $ _SESSION ['employee'] ['user name'] = $ line ['name']; ANCO "& lt; font color = red>". "" And "alt; h3 align = center" gt; "welcome". $ _ Session ['employee'] ['username']. & Lt; / H3 & gt; "." & Lt; / Font & gt; "; Echo" & lt; Br />"."<a href = 'upload_file.php' & gt; "." & Lt; Font color = 'white' & gt; "." & Lt; H4 & gt; "up load files". "; / H4 & gt; & lt;"; font> gt; "; / a & gt;"; Echo "& lt; br / >"."<br/>"."<a href = 'list_files.php' & gt; "& Lt; font color = 'white' & gt; "& Lt; H4 & gt;" "List of all up-loaded files". "& Lt; / h4 & gt;". "& Lt; font & gt;". "& Lt; / a & gt;" ; } And {echo "Login not successful"; }}} And {echo 'error! Username & amp; Password was not sent! '; }? & Gt; & Lt; / Font & gt; & Lt; A href = "logout_file.php" & gt; & Lt; Font color = "white" & gt; & Lt; Align h3 = "right" & gt; Sign out & lt; / H3 & gt; & Lt; / Font & gt; & Lt; / A & gt; & Lt; Font color = "white" & gt; & Lt; / Body & gt; & Lt; / Html & gt; Session.php & lt ;? Php session_start (); If (! Isset ($ _ session ['employee'])) {resonant "your log out"; Go out; } And {echo "lie lt; blink" "Welcome Mr.". $ _ Session ['employee'] ['username']. "& Lt; / blink & gt;"; }? & Gt;  

Apply a middle step, such as "you have logged out, you Sending to the front-page "


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -