CODE (htmlphp):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?php
- ini_set('display_errors', 0);
- $host = "localhost";
- $user = "root";
- $db = "imcody";
- mysql_connect($host,$user,'') or die(mysql_error());
- mysql_select_db($db) or die();
- if(isset($_POST['submit'])){
- $full_name = $_POST['full_name'];
- $email = $_POST['email'];
- $password = $_POST['password'];
- $repeat = $_POST['repeat'];
- if($password == $repeat){
- $password=md5($password);
- $query = mysql_query($db, "INSERT INTO user (full_name, email, password) VALUES (0,'".$_POST['full_name']."','".$_POST['email']."','".$_POST['password']."')") or die(mysql_error());
- }else{
- die('Password must match!');
- }
- }
- ?>
- <form action="registration.php" method="post" style='margin: auto; width: 300px;'>
- <ul>
- <li> <input type="text" name="full_name" placeholder=" | Full name" required style=" marging-buttom:10px; height:25px; width: 300px" /></li>
- <li><input type="text" name="email" placeholder=" | Email" requred style="height:25px; width: 300px" /></li>
- <li><input type="password" name="password" placeholder=" | Password" required style="height:25px; width: 300px" /></li>
- <li><input type="password" name="repeat" placeholder=" | Repeat password" required style="height:25px; width: 300px" /></li>
- <li><input type="submit" name="submit" value="Ok ✌" class="button" style=" margin: auto; width: 220px; padding:20px 20px; " /></li>
- </ul>
- </form>