Advertisement
Konark

Untitled

Apr 6th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2.     ob_start();
  3.     header('Content-Type: text/html; charset= utf-8');
  4.     ?>
  5. <head>
  6.     <title>reg-php</title>
  7. </head>
  8. <body>
  9.     <?php
  10.     $dbconnect = mysql_connect("localhost", "root", "")
  11.     or die("Could not connect: " . mysql_error());
  12.     print ("Connected successfully");
  13.     mysql_select_db("mysite_bd");
  14.     $nickname = $_POST['nickname'];
  15.     $password = $_POST['password'];
  16.     $email = $_POST['email'];
  17.     $name = $_POST['name'];
  18.     $dbinsert = mysql_query("INSERT INTO users(nick, password, email, name) VALUES ('$nickname', '$password', '$email', '$name')");
  19.     mysql_close($dbconnect);
  20.     header('Location: index.html');
  21.     ob_end_flush();
  22.     ?>
  23. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement