mudzakkir

user_insert.php

Jul 8th, 2012
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <?php
  2.  
  3. $nama = $_POST["nama"];
  4. $alamat = $_POST["alamat"];
  5. $username = $_POST["username"];
  6. $password = $_POST["password"];
  7. $password2 = $_POST["password2"];
  8. if ($password == $password2 && $password != '') {
  9.     require_once 'generated/include_dao.php';
  10.     $transaction = new Transaction();
  11.     $user = new User();
  12.     $user->alamat = $alamat;
  13.     $user->nama = $nama;
  14.     $user->password = $password;
  15.     $user->username = $username;
  16.     $user->permission = '9';
  17.     $data = DAOFactory::getUserDAO()->insert($user);
  18.     $transaction->commit();
  19.     if ($data != null) {
  20.         echo "<script language='JavaScript'>document.location='index.php'</script>";
  21.     }
  22. } else {
  23.     echo "<script language='JavaScript'>document.location='user_add.php'</script>";
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment