You must Sign In to post a response.
  • Category: HTML

    How to check user name and password when user click submit button

    Friends,

    i have some username and password in mysql table. my doubts is how to check user name and password when user click submit button in php and then i want to start session also when user click submit button in php and then want to destroy the session when user click logout button in php?
  • #749015
    It is very basic module in any dynamic website,So i am preffering to give reference links instead of code for your impovement. you should try your self there are thousands of solutions regarding that in google.
    I gave you some reference links which fulfil your requirement exactly with login logout code.

    http://www.sourcecodetuts.com/php/27/how-create-login-page-php-and-mysql-session

    http://phppot.com/php/php-login-script-with-session/

    http://www.codeproject.com/Tips/731648/Creating-a-Log-in-Session-in-PHP

    http://stackoverflow.com/questions/16889995/simple-login-session-php

    http://www.2my4edge.com/2013/07/simple-login-logout-system-using-php.html

    http://www.sourcecodester.com/php/4947/login-logout-session-php-practice-beginners.html

    Regards,
    Nirav Prabtani (Senior Web Developer)
    Email : niravjprabtani@gmail.com
    blog : niravprabtani.blogspot.in

  • #749032
    Hai Nepolian
    You cant get much help regarding the PHP as this website is only related to the Microsoft technologies.so if you have any question related to the Microsoft Technologies, you can post it here.
    For the PHP related issues, its better to post your question in the the related forum sites.
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #749063
    Hi Nepolian
    As you know, we are take care of all Microsoft technologies related post/doubts so I don't think you will get much help in this forum, to get desired assistance you may move this thread to some pure PHP site

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #749073
    Hi,
    As you know, this forum mainly deals with microsoft technologies so you would not get much support on php related stuffs. But below link can be very useful to you while checking the username and password from database.
    http://www.dreamincode.net/forums/topic/139905-username-and-password-match/
    http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,17/func,view/id,31885/
    http://stackoverflow.com/questions/20127682/checking-username-and-password-with-php-ajax

    Thanks,
    Ashutosh Jha
    http://tricksroad.com

  • #749086
    Check this sample code for Validating the user name and password



    Con = new SqlConnection("Server=(local)\\SQLEXPRESS;Initial Catalog=MyDatabase;Integrated Security=SSPI");
    SqlCommand cmd = new SqlCommand();
    cmd.CommandText = ("Select * from table where name='"+ txtSearch.Text +"');
    cmd.Connection = con;
    try {
    con.Open();
    sqlDataReader dr = cmd.Executereader();

    if(dr.hasRows)
    {
    while(dr.Read())
    {
    Label1.Text = dr["Id"].ToString() + " " + dr.["Address"].ToString();
    }
    }

    }
    finally {
    con.Close();
    }

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #749115
    Hi,

    As of my understanding the post you need to enable button control based on login user, if login user and database user is same then you need to enable control right..?
    If your requirement is same like above then get the login information from your database then prepare query for the same and check with system login is same as database login, if both logins are same then enable Submit button otherwise disabled.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


  • Sign In to post your comments