Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //start php tag
- //include connect.php page for database connection
- include('config.php');
- //if submit is not blanked i.e. it is clicked.
- if (isset($_REQUEST['submit'])) //here give the name of your button on which you would like //to perform action.
- {
- // here check the submitted text box for null value by giving there name.
- if($_REQUEST['user_id']=="" || $_REQUEST['password']=="")
- {
- echo " Field must be filled";
- }
- else
- {
- $sql1= "select * from users where username= '".$_REQUEST['user_id']."' && password ='".$_REQUEST['password']."'";
- $result=mysql_query($sql1)
- or exit("Sql Error".mysql_error());
- $num_rows=mysql_num_rows($result);
- if($num_rows>0)
- {
- //here you can redirect on your file which you want to show after login just change filename ,give it to your filename.
- //header("location:filename.php");
- //OR just simply print a message.
- Echo "You have logged in successfully";
- }
- else
- {
- echo "username or password incorrect";
- }
- }
- }
- ?>
- <html>
- <head>
- <title> GijoeTeam LoginPanel</title>
- <link href="css/admincp.css" rel="stylesheet" type="text/css" media="screen">
- <script src="js/jquery.js" type="text/javascript"></script>
- <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <style>
- .button {
- background-color: #4CAF50; /* Green */
- border: none;
- color: white;
- padding: 16px 32px;
- text-align: center;
- text-decoration: none;
- display: inline-block;
- font-size: 16px;
- margin: 4px 2px;
- -webkit-transition-duration: 0.4s; /* Safari */
- transition-duration: 0.4s;
- cursor: pointer;
- }
- .button1 {
- background-color: white;
- color: black;
- border: 2px solid #4CAF50;
- }
- .button1:hover {
- background-color: #4CAF50;
- color: white;
- }
- .button2 {
- background-color: white;
- color: black;
- border: 2px solid #008CBA;
- }
- .button2:hover {
- background-color: #008CBA;
- color: white;
- }
- .button3 {
- background-color: white;
- color: black;
- border: 2px solid #f44336;
- }
- .button3:hover {
- background-color: #f44336;
- color: white;
- }
- .button4 {
- background-color: white;
- color: black;
- border: 2px solid #e7e7e7;
- }
- .button4:hover {background-color: #e7e7e7;}
- .button5 {
- background-color: white;
- color: black;
- border: 2px solid #555555;
- }
- .button5:hover {
- background-color: #555555;
- color: white;
- }
- </style>
- </head>
- <body class="w3-container">
- <header class="w3-container w3-teal">
- <h1>Gijoe LoginPanel</h1>
- </header>
- <div id="loginp" class="cities">
- <p>
- <form action="login.php" method="post" enctype="multipart/form-data">
- <input type="text" id="username" name="username" placeholder="Username">
- <input type="password" id="password" name="password" placeholder="Password">
- <button type="submit" class="button button2">Login</button>
- </p>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement