Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!($connection = mysql_connect("localhost", "bbbbb","addaasasad")))
- die("false_CANT_CONNECT_TO_DATABASE");
- if(!(mysql_select_db("flash")))
- die("false_DATABASE_DOESNT_EXIST");
- if(!(isset($_POST['do'])))
- exit("false_MISSING_VAR_'do'");
- if(!(isset($_POST['password'])))
- exit("false_MISSING_VAR_'password'");
- if(!(isset($_POST['user'])))
- exit("false_MISSING_VAR_'user'");
- if(!(isset($_POST['gameID'])))
- exit("false_MISSING_VAR_'gameID'");
- $action = $_POST['action'];
- $password = $_POST['password'];
- $user = $_POST['user'];
- $parameter1 = (int)$_POST['parameter01'];
- $parameter2 = (int)$_POST['parameter02'];
- $parameter3 = (int)$_POST['parameter03'];
- $game = (string)$_POST['gameID'];
- if(!($password == "42220404404847"))
- exit("false_WRONG_AUTHENTIFICATON");
- if(is_string($user) == false)
- exit("false_UNEXPECTED_VAR_TYPE_user");
- if(!(strlen($user)<24))
- exit("false_VAR_(user)_TOO_LONG");
- if(!(strlen($user)>4))
- exit("false_VAR_(user)_TOO_SHORT");
- if ($action == 'addscore')
- {
- if(!(isset($_POST['parameter01'])))
- exit("false_MISSING_VAR_'parameter01'");
- if(is_int($parameter1) == false)
- exit("false_UNEXPECTED_VAR_TYPE_highscore");
- $insert = "INSERT INTO $game (name, score) VALUES ('$user', '$highscore')";
- if ($test == mysql_query($insert))
- {
- mysql_close($connection);
- exit ("false_ADDSCORE");
- }
- else
- {
- mysql_close($connection);
- exit ("true_ADDSCORE");
- }
- }
- else
- {
- exit ("false_WRONG_ACTION");
- }
- mysql_close($connection);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement