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

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


    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.

    Nirav Prabtani (Senior Web Developer)
    Email :
    blog :

  • #749032
    Hai Nepolian
    You cant get much help regarding the PHP as this website is only related to the Microsoft 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.

    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)

  • #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

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

  • #749073
    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.,com_kunena/Itemid,232/catid,17/func,view/id,31885/

    Ashutosh Jha

  • #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 {
    sqlDataReader dr = cmd.Executereader();

    Label1.Text = dr["Id"].ToString() + " " + dr.["Address"].ToString();

    finally {

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #749115

    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.

    Blog :

  • Sign In to post your comments