Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled Document</title>
- </head>
- <body>
- <?php
- function sanitize($data)
- {
- if(get_magic_quotes_gpc())
- {
- $data = stripslashes($data);
- }
- return $data;
- }
- $servername = "localhost";
- $username = "playground18";
- $password = "Cdz5SOVrY2p8fnWS";
- $dbname = "playground18";
- $user = sanitize($_GET['user']);
- $pass = sanitize($_GET['pass']);
- $encryptedPass = sha1($pass);
- $ip=$_SERVER['REMOTE_ADDR'];
- try {
- $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- // set the PDO error mode to exception
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $sql = "INSERT INTO tanay_xcatt_runners (name, password, ip)
- VALUES ('$user', '$encryptedPass', '$ip')";
- // use exec() because no results are returned
- $conn->exec($sql);
- echo "New account created successfully";
- }
- catch(PDOException $e)
- {
- echo $sql . "<br>" . $e->getMessage();
- }
- $conn = null;
- header("Location: runnerLoginForm.html");
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment