Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = check_input($_POST['username'],"<font color='red'>Enter your username!</font>");
- $email = check_input($_POST['email'],"<font color='red'>Enter your email!</font>");
- ?>
- <?php
- function check_input($data, $problem='')
- {
- $data = trim($data);
- $data = mysql_real_escape_string($data);
- $data = htmlspecialchars($data);
- if ($problem && strlen($data) == 0 && ctype_alnum($data))
- {
- die($problem);
- }
- return $data;
- }
- ?>
- <?php
- $dbserver = "174.121.1.62";
- $dblogin = "scswccla_Mine";
- $dbpassword = "***********";
- $dbname = "scswccla_mine";
- $con = mysql_connect("$dbserver","$dblogin","$dbpassword");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("$dbname", $con);
- $sql="INSERT INTO users (id, name, groups, prefix, commands, admin, canmodifyworld, ignoresrestrictions, ip, email)
- VALUES('','$username','players','','','0','1','0','','$email')";
- if (!mysql_query($sql,$con))
- {
- die('<font color="red">Error: ' . mysql_error() . '</font>');
- }
- else {
- echo('<font color="green">Success!</font>');
- }
- mysql_close($con)
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement