Advertisement
Guest User

Untitled

a guest
Aug 11th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.03 KB | None | 0 0
  1. <html>
  2. <body>
  3. <form method=POST>
  4. input your login*&nbsp &nbsp &nbsp &nbsp&nbsp&nbsp <input type="text" name='login' maxlength="20"></br>
  5. input your name*&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="text" name='name' maxlength="20"></br>
  6. input your secname *&nbsp&nbsp <input type="text" name="secname" maxlength="20"></br>
  7. input your email*&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="text" name="email" maxlength="20"></br>
  8. input your password * <input type="password" name="password" maxlength="20"></br>
  9. <input type="submit" name='submit' value='REGISTRATION'></form>
  10. <?PHP
  11. if(isset($_POST['submit']))
  12. {
  13.     if(isset($_POST['login']))
  14.     {
  15.         if($_POST['name'])
  16.         {
  17.             if($_POST['secname'])
  18.             {
  19.                 if($_POST['email'])
  20.                 {
  21.                     if($_POST['password'])
  22.                     {
  23.                         $dbname='users';
  24.                         $dbhost='localhost';
  25.                         $dbuser="root";
  26.                         $dbpass="";
  27.                         $password=md5($_POST['password']);
  28.                         $login=$_POST['login'];
  29.                         $name=$_POST['name'];
  30.                         $secname=$_POST['secname'];
  31.                         $email=$_POST['email'];
  32.                         if($link=mysql_connect($dbhost,$dbuser,$dbpass))
  33.                         {
  34.                             if(mysql_select_db($dbname))
  35.                             {
  36.                                 $zapros="INSERT into users values('$i','$name','$secname','$email','$login','$password')";
  37.                                 $i++;
  38.                                 if(mysql_query($zapros, $link))
  39.                                 {
  40.                                     echo"dear $name, your registration was finished succsessful!, your login is a $login";
  41.                                     if(file_exists('login.php'))
  42.                                     {
  43.                                         require_once('login.php');
  44.                                     }
  45.                                     else
  46.                                     {
  47.                                         echo" the login.php does not exists";
  48.                                     }
  49.                                 }
  50.                             }
  51.                             else
  52.                             {
  53.                                 echo "can't select database";
  54.                             }
  55.                         }
  56.                         else
  57.                         {
  58.                             echo"can't connect to database";
  59.                         }
  60.                     }
  61.                     else
  62.                     {
  63.                         echo"write a password";
  64.                     }
  65.                 }
  66.                 else
  67.                 {
  68.                     echo"write a email";
  69.                 }
  70.             }
  71.             else
  72.             {
  73.                 echo "write a secname";
  74.             }
  75.         }
  76.         else
  77.         {
  78.             echo "write a name";
  79.         }
  80.     }
  81.     else
  82.     {
  83.         echo "write a login";
  84.     }  
  85. }
  86. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement