Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function main($formUse = true)
- {
- $link = mysql_connect('bondsolutionsnjcom.fatcowmysql.com', 'lightswitch', '*password*');
- if (!$link) {
- die('Could not connect: ' . mysql_error());
- }
- echo 'Connected successfully';
- mysql_select_db('red_light_life_accounts1');
- // This could be supplied by a user, for example
- $username;
- $password;
- if(!$username || !$password) {
- echo "Login or password cant be empty.";
- } else {
- $SQL = "SELECT * FROM accounts WHERE username = '$username' & password = '$password'";
- $result_id = @mysql_query($SQL) or die("DATABASE ERROR!");
- $total = mysql_num_rows($result_id);
- if($total >= 1) {
- $datas = @mysql_fetch_array($result_id);
- $count = strlen($password);
- $count2 = strlen($datas['passwird']);
- if(!strcmp($count, $count2)) {
- echo "Success";
- } else {
- echo "Username or password is wrong.";
- }
- } else {
- echo "Data invalid - cant find username.";
- }
- }
- }
- // Close mySQL Connection
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement