Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('recaptchalib.php');
- $privatekey = "6LeZl74SAAAAAMtfiIIfBtNH2bt0SoN-OzkcBkzq";
- $resp = recaptcha_check_answer ($privatekey,
- $_SERVER["REMOTE_ADDR"],
- $_POST["recaptcha_challenge_field"],
- $_POST["recaptcha_response_field"]);
- if (!$resp->is_valid) {
- // What happens when the CAPTCHA was entered incorrectly
- die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
- "(reCAPTCHA said: " . $resp->error . ")");
- } else {
- // Your code here to handle a successful verification
- include "functions.php";
- if(isset($_POST['submit']))
- {
- $server = "SERVER1\SQLEXPRESS";
- $user = "";
- $pass= "";
- $username = strtolower(trim(htmlspecialchars(addslashes(preg_replace("/[^a-zA-Z0-9]/" , "" , $_POST['username'])))));
- $password = md5("kikugalanet", preg_replace("/[^a-zA-Z0-9]/" , "" , $_POST['password']);
- ################################################## ###########
- if(strlen($username) < 4 ||
- strlen($username) > 16)
- {
- die("Dein Benutzername ist zu kurz/lang .<br>Er muss zwischen <b><u>4 und 16</u></b> Zeichen lang sein .");
- echo '<a href="index.html">Home</a>';
- }
- if(strlen($_POST['password']) < 4 ||
- strlen($_POST['password']) > 16)
- {
- die("Dein Passwort ist zu kurz/lang .<br>Es muss zwischen <b><u>4 und 16</u></b> Zeichen lang sein .");
- echo '<a href="index.html">Home</a>';
- }
- ################################################## ###########
- $conn = mssql_connect($server,$user,$pass);
- if(!$conn)
- {
- die("Connection failed!<br>");
- }
- $select = mssql_select_db("ACCOUNT_DBF",$conn);
- if(!$select)
- {
- die("Can't select Database!<br>");
- }
- ################################################## ###########
- if(exist($username) != '0')
- {
- die ("Der Benutzername ".$username." wird schon benutzt .");
- echo '<a href="index.html">Home</a>';
- }
- ################################################## ###########
- $bind = mssql_init("createaccount",$conn);
- if(!$bind)
- {
- die("Couldn't Bind Variables.<br>");
- }
- $acc = $username;
- $pass = $password;
- $ipadress = $ip;
- mssql_bind($bind, '@account' , $acc , SQLVARCHAR);
- mssql_bind($bind, '@password', $pass, SQLVARCHAR);
- $execute = mssql_execute($bind);
- if($execute)
- {
- echo 'Account wurde <font color="green">erfolgreich</font> erstellt !';
- echo '<a href="index.html">Home</a>';
- }
- else
- {
- echo 'Account erstellung<font color="red">fehlgeschlagen</font> !';
- echo '<a href="index.html">Home</a>';
- }
- mssql_close($conn);
- }
- else
- {
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement