Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Start a session
- session_start();
- //unset and reset any existing session
- session_unset();
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <script type="text/javascript">
- function delayedRedirect()
- {
- window.location = "url to page you want to go after login"
- }
- </script>
- </head>
- <body onLoad="setTimeout('delayedRedirect()', 8000)" style="background-color:#fff;">
- <?php
- //this is a link to my connection string. you can type it here as well
- include 'tconslocal.php';
- //eg: $con = mysqli_connect('server','username','password','database') or die('Unable To connect');
- //assign variable here either through post or get
- //for post use this
- $username=mysqli_real_escape_string($con,$_POST['username']);
- $password=mysqli_real_escape_string($con,$_POST['password']);
- //for GET use this
- $username=mysqli_real_escape_string($con,$_GET['username']);
- $password=mysqli_real_escape_string($con,$_GET['password']);
- echo "this is username: ".$username;
- echo "|| This is password: ".$password;
- //$mysql_query="SELECT * FROM tablename where username= '$username' AND password= '$password'";
- //$result = mysqli_query($con,$mysql_query);
- //$count= mysqli_num_rows($result);
- // If result matched username and password, table row must be 1 row
- //if($count>0)
- //{
- //use this if you will be using the table information in the row returned
- //while($row = $result->fetch_assoc())
- //{
- //here iam assigning the id from the table row into a session variable so i can use it later
- //$_SESSION['SESS_userID'] = $row['userid'];
- //close the session write process when done
- //session_write_close();
- //}
- //echo "User Has Been Logged In Successfully. You will be redirected to the dashbooard in 5 seconds";
- //exit;
- //}
- //else
- //{
- //echo "User Not Found. You will be redirected to the dashbooard in 5 seconds";
- //exit;
- //}
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement