Guest User

my name jeff

a guest
Feb 27th, 2018
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2.     if (isset($_POST["username"]) and isset($_POST["password"]))
  3.     {
  4.         $username = $_POST["username"];
  5.         $password = $_POST["password"];
  6.        
  7.         // connect to database
  8.         $dbc = mysql_connect ('localhost','id4834055_jammyhall','password');
  9.         mysql_select_db('id4834055_blogbase');
  10.         // run insert query
  11.         $result = mysql_query("INSERT INTO user (username, password) VALUES ('$username','$password')");
  12.         // redirect to login page
  13.         header("location:login.php");
  14.     }
  15.     else
  16.     {
  17.         // username or password not posted, redirect back to add user form
  18.         header("location:Signup.php");
  19.     }
  20. ?>
Add Comment
Please, Sign In to add comment