Guest User

join2.php

a guest
Jun 29th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2. $email = "";
  3. $username = "";
  4. $password = "";
  5. if( isset($_POST['email']) ) {
  6.     $email = $_POST['email'];
  7. }
  8. if( isset($_POST['username']) ) {
  9.     $username = $_POST['username'];
  10. }
  11. if( isset($_POST['password']) ) {
  12.     $password = $_POST['password'];
  13. }
  14. $joinok = 0;
  15. if( $email && $username && $password ) {
  16.     require("dbcon.php");
  17.     $presql = "select email from user ";
  18.     $presql .= " where email='{$email}'";
  19.     $prers = $db->query($presql);
  20.     $count = $prers->rowCount();
  21.     if( $count == 0 )   {
  22.         $sql = "insert into user set ";
  23.         $sql .= " email='{$email}'";
  24.         $sql .= ", username='{$username}'";
  25.         $sql .= ", password='" . md5($password) . "'";
  26.         $sql .= ", rdate=now()";
  27.         if( $db->query($sql) ) $joinok = 1;
  28.     }
  29. }
  30. echo $joinok;
Add Comment
Please, Sign In to add comment