Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("config.php");
- if(isset($_POST['method'])) {
- if($_POST['method'] == "login") {
- login($_POST['username'],$_POST['password']);
- } else {
- }
- }
- function login($usr,$pwd) {
- global $conn;
- $username = htmlspecialchars($usr);
- $password = md5(htmlspecialchars($pwd));
- $check_q = $conn->query("SELECT * FROM `users` WHERE `username` = '$username' AND `password` = '$password'");
- $check = $check_q->num_rows;
- if($check == 1) {
- return 1;
- } else {
- return 0;
- }
- return 0;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement