Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // I always put the DB connection at the top of the page, and often put it in a seperate file and include it
- $con = mysql_connect("localhost","bam_Admin","[pass]");
- mysql_select_db("bam_example");
- if (!$con) {
- die(' Error: ' . mysql_error());
- }
- $username = $_POST['username'];
- $password = $_POST['password'];
- if($username || $password || $_POST['submit']) {
- $es_username = mysql_real_escape_string($username);
- $es_password = mysql_real_escape_string($password);
- $check_login = mysql_query("SELECT * FROM `Log` WHERE `username` = '".$es_username."' AND `password` = '".$es_password."'");
- if(mysql_num_rows($check_login) == 0){
- echo "Fail x.X";
- }else{
- echo "Win";
- }
- }
- ?>
- <form method="post" action="login.php?F=login">
- <input type='text' name='username' value='User' />
- <input type='password' name='password' value='Password' />
- <input type='submit' name='submit' value='Login' />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement