login page

login page

 

using System.Data;
using System.Data.SqlClient;

private void btnlogin_Click(object sender, EventArgs e)
   {
 SqlConnection con = new SqlConnection("Data Source=WINCTRL-NAA1ARS\\SQLEXPRESS;Initial Catalog=dbdemo;Integrated Security=True");
 con.Open();
string query = "select count(*) from tbluser where user_name='" + txtusername.Text + "' AND pass='" + txtpassword.Text + "'";
SqlCommand cmd = new SqlCommand(query, con);
string output=   cmd.ExecuteScalar().ToString();
 if (output == "1")
{
 lblmessage.Text = "Successfully Log In";
 }

 else
{
 lblmessage.Text = "Not Found user name and password! or Wrong Details";
 }
con.Close();
 }

 

 

<!DOCTYPE html>
<html>
<body>

<?php
echo "My first PHP script!";
?>

</body>
</html>