Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <?php
- require 'credentials.php';
- session_start();
- $error = "nothing to see here. Yet.";
- $userID = 0;
- $errorMsg='No error message generated';
- if($_SERVER["REQUEST_METHOD"]=== "POST")
- {
- $username = mysqli_real_escape_string($conn,$_post['username']);
- $password = mysqli_real_escape_string($conn,$_post['Password']);
- If(!$conn->query("Set @outuser=''") || !$conn->query("Set @outmessage=''") || $conn->query("CALL dologin($username, $password,@outuser, @outmsg);"))
- {
- echo "call failed: (" . $conn->errno . ")" .$conn->error;
- }
- if(!($rsUsr = $conn->query ("Select @outUser AS _dologin_out")))
- {
- echo "Fetch failed: (" . $conn->errno . ") " . $conn->error;
- }
- if(!($rsError = $conn->query ("Select @outmsg AS _dologin_out")))
- {
- echo "Fetch failed: (" . $conn->errno . ") " . $conn->error;
- }
- $usrRow= $rsUsr->fetch_assoc();
- $userID = $usrRow['_dologin_out'];
- $msgRow = $rsError->fetch_assoc();
- $errorMsg = $msgRow ['_dologin_out'];
- echo $userID;
- echo $errorMsg;
- }
- ?>
- <head>
- <meta charset="UTF-8">
- <title>Login Page</title>
- <style type ='text/css'>
- body
- {
- font-family:Arial,Helvetica, sans-serif;
- font-size:14px;
- }
- label
- {
- font-weight:bold;
- width:100px;
- font-size:14px;
- }
- box
- {
- border:#666666 solid 1px;
- }
- </style>
- </head>
- <body bgcolor = #fffffff>
- <div align "center">
- <div style =" width:300px, border: solid 1px" align ="left">
- <div style =" background-color:#333333; color:#FFFFFFF padding:3px"><b>
- <div style ="margin:30px">
- <form action = "" method = "post">
- <label>UserName :</label><input type ="text" name ="username" class ="box"/><br /><br />
- <label>Password :</label><input type ="password" name ="password" class ="box"/><br /><br />
- <input type ="submit" value ="submit"/><br />
- </form>
- <div style ="font-size:11px; color #cc0000 margin-top:10px"><?php echo $error . " ". $errorMsg ; ?></div>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement