Skip to content

Instantly share code, notes, and snippets.

@vranac vranac/sample.php
Created Dec 27, 2016

Embed
What would you like to do?
<?php
session_start();
$db= mysqli_connect('localhost', 'korisnik1', '12345', 'baza1');
if(isset($_POST['send'])){
$pass=addslashes($_POST['pass']);
$sql=" SELECT * FROM baza1 WHERE pass='$pass' ";
$result=mysqli_query($db,$sql);
if(mysqli_num_rows($result)==1){
$_SESSION['message']="Konektovani ste na bazu podataka";
$_SESSION['pass']=$pass;
header("Location:korisnicki.php");
}else{
$_SESSION['message']="Uneti podaci nisu tacni";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.