Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="mysql.hostinger.hu"; //host. gondolom nektek is ez, mivel Hostingeresek vagytok.
- $user=""; //felhasználónév
- $pass=""; //jelszó
- $dbname=""; //adatbázis neve
- $options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
- // A try/catch statement is a common method of error handling in object oriented code.
- // First, PHP executes the code within the try block. If at any time it encounters an
- // error while executing that code, it stops immediately and jumps down to the
- // catch block. For more detailed information on exceptions and try/catch blocks:
- // http://us2.php.net/manual/en/language.exceptions.php
- try
- {
- // This statement opens a connection to your database using the PDO library
- // PDO is designed to provide a flexible interface between PHP and many
- // different types of database servers. For more information on PDO:
- // http://us2.php.net/manual/en/class.pdo.php
- $db = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $user, $pass, $options);
- }
- catch(PDOException $ex)
- {
- // If an error occurs while opening a connection to your database, it will
- // be trapped here. The script will output an error and stop executing.
- // Note: On a production website, you should not output $ex->getMessage().
- // It may provide an attacker with helpful information about your code
- // (like your database username and password).
- die("Failed to connect to the database: " . $ex->getMessage());
- }
- if($_GET)
- {
- $name = strip_tags($_GET['username']);
- $stmt=$db->prepare("SELECT username FROM users WHERE username=:name");
- $stmt->execute(array(':name'=>$name));
- $count=$stmt->rowCount();
- if($count>0)
- {
- die("{\"login\":\"OK\",\"skin\":\"ide kell beilleszteni a skin lekérését.\",\"defaultskin\":\"http://pornhub.com, őőő, ja, izé, ide kell az alap skin.\"}");
- }
- else
- {
- print("2");
- }
- }
- ?>
Add Comment
Please, Sign In to add comment