Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function clean($string) {
- $string = trim($string); // Strip whitespace from the beginning of a string.
- $string = strip_tags($string); // Strip HTML and PHP tags.
- if (!get_magic_quotes_gpc()) { // Returns 0 if magic_quotes_gpc is off, 1 otherwise.
- $string = addslashes($string);
- }
- $string = rtrim($string); // Strip whitespace from the end of a string.
- return $string; // Return the final string.
- }
- $username = $_GET['username'];
- $password = $_GET['password'];
- mysql_connect("localhost", "YOUR USER", "YOURvPASS") or die(mysql_error());
- mysql_select_db("runehubc_rscbot") or die(mysql_error());
- //$result = mysql_query("SELECT password, bAccess FROM `smf_members` WHERE member_name = '" . clean($username) . "'");
- $result = mysql_query("SELECT password, bAccess FROM `smf_members` WHERE member_name = '" . clean($username) . "'");
- if(mysql_num_rows($result) > 0){
- $row = mysql_fetch_array( $result );
- //$row = mysql_fetch_row($result);
- if($row['password'] == $password){
- echo $row['bAccess'];
- } else {
- echo "Incorrect Password";
- }
- } else {
- echo "Incorrect Username";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement