Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("./inc/config.php");
- include("./inc/functions.php");
- define( _DEBUG, true );
- session_start();
- if(!isset( $_SESSION['szUser'] ) )
- {
- if(!isset( $_POST['login'] ) || !isset( $_POST['pwd'] ) )
- {
- echo <<< HTML
- Please log in <br />
- <form action="" method="POST">
- Username: <input type="text" name="login" /><br />
- Password: <input type="password" name="pwd" /><br />
- <input type="submit" value="Log in!" />
- </form>
- HTML;
- }
- else
- {
- // Check for passes
- MsSQLConnection();
- $szQuery = "SELECT * from [PROJECT_DBF].[dbo].[ACCT_TBL] where account = 'login' AND password = 'pwd'";
- $nRes = mssql_num_rows( mssql_query( $szQuery ) );
- if( $nRes == 1 )
- {
- $_SESSION['szUser'] = $_POST['login'];
- $_SESSION['szPassword'] = $_POST['pwd'];
- echo "You have been sucessfully logged in";
- }
- else
- echo "The credidentials you have provided are incorrect.";
- }
- }
- elseif( isset( $_POST['logOut'] ) )
- {
- session_destroy();
- echo "You have been successfully logged out.";
- }
- else
- {
- echo "You are already logged in.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement