emprit

insert

Jun 29th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2. session_start();
  3.     ?>
  4.     <link rel="stylesheet" href="http://localhost/keuangan/emprit/setting/background.css" type="text/css"></link>
  5.     <?php
  6. include "../../koneksi.php";
  7. function spesial($text){
  8. $text = htmlspecialchars($text);
  9. $text = preg_replace("/=/", "=\"\"", $text);
  10. $text = preg_replace("/&quot;/", "\"", $text);
  11. $tags = "/&lt;(\/|)(\w*)(\ |)(\w*)([\\\=]*)(?|(\")\"&quot;\"|)(?|(.*)?&quot;(\")|)([\ ]?)(\/|)&gt;/i";
  12. $replacement = "&lt;$1$2$3$4$5$6$7$8$9$10&gt;";
  13. $text = preg_replace($tags, $replacement, $text);
  14. $text = preg_replace("/=\"\"/", "=", $text);
  15. $text = nl2br($text);
  16. $text = preg_replace("/&quot;/", "&quot;&quot;", $text);
  17.  
  18. return $text;
  19. }
  20. $pass=sha1($_POST['pass']);
  21. $nama=spesial($_POST['nama']);
  22. mysql_query("INSERT INTO user values ('','$_POST[username]','$pass','$nama','$_POST[level]','$_POST[alamat]','$_POST[email]')")or die(mysql_error());
  23. echo "<H2><center>Proses Tambah User sudah masuk!</center></H2>";
  24. $hal="user.php";
  25. echo "<meta http-equiv=\"refresh\" content=\"2;url=$hal\">";
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment