Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <h1 align="center">Create your user admin</h1>
- <table align="center">
- <tr align="center">
- <td align="left">
- <FORM style="width:300px; float:left;" id="form" name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
- <label>username:</lable><input style="margin-left:10px;" type="field" id="username" name="username"></br>
- <label>password:</lable><input style="margin-left:10px;" type="field" id="password" name="password"></br>
- <label>email:</lable><input style="margin-left:35px;" type="field" id="email" name="email"></br>
- <input type="submit" name="submit" value="submit"></br>
- </form>
- </td>
- </tr>
- </table>
- <?php include_once("../connect/config.php");
- if(empty($_POST['username'])) { die('</body></html>'); }
- $username = $_POST["username"];
- $password = $_POST["password"];
- $email = $_POST["email"];
- mysql_select_db('$db_selected') or die('Cannot select database you suck try again');
- if(isset($_POST['submit']))
- {
- $query = 'CREATE TABLE users( '.
- 'id INT NOT NULL AUTO_INCREMENT, '.
- 'username VARCHAR(20) NOT NULL, '.
- 'password VARCHAR(50) NOT NULL, '.
- 'email VARCHAR(30) NOT NULL, '.
- 'PRIMARY KEY(id))';
- $result = mysql_query($query);
- mysql_select_db('$db_selected') or die('Cannot select database you suck try again');
- $sql="INSERT INTO users ($username, $password, $email)
- VALUES ('$username','$password','$email')";
- if (!mysql_query($sql)) { die('Error: ' . mysql_error()); }
- echo "1 record added"; }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment