Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Loginovanje
- <table width="444" height="54" border="0" cellpadding="0">
- <tr>
- <td><font color="white">Username : </font></td>
- <td><font color="white">Password : </font></td>
- <td> </td>
- </tr>
- <tr><form method="POST" action="">
- <td><input type="TEXT" name="username" class="textbox"></td>
- <td><input type="password" name="password" class="textbox"></td>
- <td><input type="submit" name="send" class="submit"></td>
- </tr></form>
- </table>
- <?php
- $username=$_POST['username'];
- $password=$_POST['password'];
- $md5pw=md5($password);
- $query="SELECT * FROM gz_korisnici WHERE username='$username' and password='$md5pw'" ;
- $sq=mysql_query($query);
- if($_POST['send']){
- echo "" ;
- if(mysql_num_rows($sq) == 1){
- $_SESSION['username'] = $username ;
- $_SESSION['password'] = $password ;
- echo "<script>window.location=\"index.php\"</script>" ;
- mysql_query("INSERT INTO gz_online (ko,broj) VALUES ('$username','1')");
- } else {
- echo "<script>alert('Username ili Password nije tacan !')</script>" ;
- }
- }
- ?>
- //reg
- <table width="444" height="54" border="0" cellpadding="0">
- <tr><form method="POST" action="">
- <td><font color="white">Username : </font></td>
- <td><input type="TEXT" name="user" class="textbox"></td>
- </tr>
- <tr>
- <td><font color="white">Password :</font></td>
- <td><input type="password" name="pw" class="textbox"></td>
- </tr>
- <tr>
- <td><font color="white">E-Mail : </font></td>
- <td><input type="TEXT" name="email" class="textbox"></td>
- </tr><tr><td></td>
- <td><input type="submit" name="send2" class="submit" value="Posalji"></td>
- </tr></form>
- </table>
- <?php
- $user=$_POST['user'];
- $pw=$_POST['pw'];
- $email=$_POST['email'];
- $pwmd5=md5($pw);
- if($_POST['send2']){
- echo "" ;
- if($user == "" || $pw=="" || $email == ""){
- echo "<script>alert('Unesite podatke !')</script>" ;
- } else {
- $sql1="INSERT INTO gz_korisnici (username,password,email) VALUES ('$user','$pwmd5','$email')" ;
- mysql_query($sql1) or die(mysql_error());
- echo "<script>alert('Uspjesno si se registrovao !')</script>" ;
- }
- }
- ?>
Add Comment
Please, Sign In to add comment