Fix voor Erwin
By: Xmoo | Date: Mar 12 2009 11:41 | Format: PHP | Expires: never | Size: 1.29 KB | Hits: 1117
- <?php
- $host = "localhost"; // Host name
- $username = "root"; // Mysql username
- $password = ""; // Mysql password
- $db_name = "intranet"; // Database name
- $tbl_name = "users"; // Table name
- // Connect to server and select databse.
- // username and password sent from form
- $myusername = $_POST['username'];
- $mypassword1 = $_POST['password'];
- // To protect MySQL injection
- $sql="SELECT * FROM ".$tbl_name." WHERE username='".$myusername."' and password='".$mypassword."'";
- // Mysql_num_row is counting table row
- // If result matched $myusername and $mypassword, table row must be 1 row
- if($count==1){
- // Register $myusername, $mypassword and redirect to file "login_success.php"
- $_SESSION['myusername'] = $count->myusername;
- $_SESSION['mypassword'] = $count->mypassword;
- }
- else {
- echo "Wrong Username or Password";
- }
- ?>
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago