Advertisement
Walker1998

server.php

Oct 15th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2.     $mysqli = new mysqli("localhost", "root", "Admirih123", "mreza");
  3.     $mail = $_GET["mail"];
  4.     $sqlprovjera = "select * from Korisnik where E_mail='$mail'";
  5.     if($result = $mysqli->query($sqlprovjera))
  6.     {
  7.         $row_cnt = $result->num_rows;
  8.         if($row_cnt==1)
  9.         {
  10.             echo("Korisnik je registrovan vec");
  11.             $result->close();
  12.         }
  13.         else
  14.         {
  15.         $sql = "INSERT INTO Korisnik VALUES('".$_GET['mail']."','".$_GET['ime']."','".$_GET['prezime']."')";
  16.         $mysqli->query($sql);
  17.         echo("Korisnik je uspjesno registrovan.");
  18.         }
  19.     }
  20.     $mysqli->close();
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement