Facebook
From Speedy Rhinoceros, 1 Week ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 51
  1. <?php include("connection.php");?>
  2. <?php
  3.     global $connection;
  4.     global $errordanger;
  5.     global $uspehreg;
  6.     global $neuspehreg;
  7.  
  8.     $sime = $sprezime = $semail = $spassw = $squery= "";
  9.  
  10.  
  11.     if(isset($_POST['submit'])){
  12.             if(!empty($_POST["ucemail"]) && !empty($_POST["ucpassword"])){
  13.        
  14.        
  15.         $sime = $_POST['ucime'];
  16.         $sprezime = $_POST['ucprezime'];
  17.         $semail = $_POST['ucemail'];
  18.         $spassw = $_POST['ucpassword'];
  19.        
  20.         //Provera da li korisnik vec postoji
  21.        
  22.        
  23.         $ssql_query = mysqli_query($connection, "SELECT uemail FROM ucsignup WHERE uemail = '{$semail}' ");
  24.         $scount = mysqli_num_rows($ssql_query);
  25.        
  26.         if($scount > 0){
  27.            
  28.             $errordanger = "<div class='alert alert-danger fade in alert-dismissible'>
  29.   <a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>
  30.   <strong>Korisnik sa tom e-mail adresom već postoji!</strong></div>";
  31.            
  32.            
  33.         }else{
  34.            
  35.             $ffname = mysqli_real_escape_string($connection, $sime);
  36.             $llname = mysqli_real_escape_string($connection, $sprezime);
  37.             $eemail = mysqli_real_escape_string($connection, $semail);
  38.             $ppassword = mysqli_real_escape_string($connection, $spassw);
  39.            
  40.            
  41.         $ssql = "INSERT INTO ucsignup(uemail, uime, uprezime, upassword, date_time) VALUES ('{$semail}' , '{$sime}', '{$sprezime}', '{$spassw}', now()) ";
  42.            
  43.         $squery = mysqli_query($connection, $ssql);}
  44.            
  45.         if($squery){
  46.             $uspehreg = "<div class='alert alert-success alert-dismissible'>
  47.   <a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>
  48.   <strong>Uspešno ste se registrovali!</strong></div>";
  49.            
  50.        
  51.         }    
  52.        
  53.            
  54.     else{
  55.        
  56.         $neuspehreg = "<div class='alert alert-danger fade in alert-dismissible'>
  57.   <a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>
  58.   <strong>Morate uneti ime, prezime, e-mail i šifru!</strong></div>";
  59.            
  60.            
  61.       }    
  62.        
  63.    
  64.             }}
  65.  
  66. ?>
  67.