Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- // Get data from form
- $username = $_POST['username'];
- $password = $_POST['password'];
- // Include the file which contains the database setup and configuration
- include("base.php");
- // Look in database to see if there are any account with the chosen username and password
- $sql_uname_check = "SELECT * FROM people WHERE username='$username' AND password='$password';";
- // So this says have a look and see if there is an account in the people table with the selected username AND password
- // Run the query and put the results in a variable
- $result_name_check = mysql_query($sql_uname_check);
- // Count how many users were returned
- $peepsfound = mysql_num_rows($result_name_check);
- // there were 0 users found ( < 1)
- if ($peepsfound < 1) {
- // Error not found
- $error = "User $uname not found.";
- //If there was a user found
- } else {
- //Add their details to the session for use later
- $_SESSION['unamename'] = $uname;
- $_SESSION['encryptcode'] = $code;
- }
- }
- /* End of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement