Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- require("..\configuration.php");
- if(isset($_POST['name'])){
- $username = mysql_real_escape_string($_POST['name']);
- echo($username);
- $password = md5(mysql_real_escape_string($_POST['email']));
- $query = mysql_query("SELECT * FROM `admin` WHERE `username` = '$username' AND `password` = '$password'");
- $file = fopen("{$_SERVER['TMP']}/hi.txt", "w");
- fwrite($file, "hi");
- fclose($file);
- if( mysql_num_rows($query) >= 1 ) {
- session_start();
- $_SESSION['username'] == $username;
- $sessionid = session_id();
- die($_SESSION['username']);
- header("LOCATION: index.php?PHPSESSID=$sessionid");
- } else {
- $err = "Invalid username or password.";
- }
- }
- ?>
- Results:
- arleslie
- Notice: Undefined index: username in C:\xampp\htdocs\login.php on line 14
- Notice: Undefined index: username in C:\xampp\htdocs\login.php on line 16
Add Comment
Please, Sign In to add comment