Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //MySql database varibles
- $host = 'mysql7.000webhost.com';
- $database = 'a5580827_yuriah';
- $db_username = 'a5580827_kelvin';
- $db_password = 'monmon123';
- //Connect to the MySQL database
- if (($db = new PDO("mysql:host=$host;dbname=$database", $db_username, $db_password)) == NULL) {
- echo $db->getMessage();
- }
- //POST the username and password
- $username = $_POST['username'];
- $password = sha1(sha1($_POST['username']) . sha1($_POST['password']));
- $errors = "";
- if (!isset($_POST['username']))
- $errors .= "Please provide a username. <br/>";
- if (!isset($_POST['password']))
- $errors .= "Please provide a password. <br/>";
- if (!isset($_POST['email']))
- $errors .= "Please provide an email address. <br/>";
- if ($errors == "") { mysql_query("INSERT INTO Members VALUES('','".addslashes($_POST['username'])."','".md5($_POST['password])."',.addslashes($_POST['email'])."'))
- or die(mysql_error());
- echo "Registration Successful!";
- } else {
- echo $errors."Please go back and try again.";
- }
- ?>
Add Comment
Please, Sign In to add comment