Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $link=mysqli_connect('localhost','t224','t224','t224');
- if(!isset($_SEESION['enter']) || (isset($_GET['exit'])&& $_GET['exit'] == 'on')){
- $_SESSION['enter']=false;
- }
- if(isset($_GET['add']) && $_GET['add'] == 'on'){
- echo '<FORM NAME="form1" action="8.het.php" method="POST">
- <INPUT TYPE="text" name="user">
- <INPUT TYPE="text" name="pass">
- <INPUT TYPE="submit" name="add" value="Létrehoz">
- </FORM>';
- }
- if(isset($_POST['add'])){
- $sql='INSERT INTO `user` (`nev`, `jelszo`, `jog`) VALUES ("'.$_POST['user'].'", "'.$_POST['pass'].'", "0")';
- }
- if(isset($_POST['submit'])){
- $sql='SELECT nev as `user`, jelszo as `pass` FROM `user` WHERE nev="'.$_POST['user'].'= and jelszo="'.$_POST['pass'].'" ';
- $result(mysqli_query($link,$sql));
- if(mysqli_num_rows($result)==1){
- $_SESSION['enter']=true;
- }
- }
- //hozzunk létre egy 2 dimenziós tömböt az adatbázisból
- if(isset($_SESSION['enter'])&&$_SESSION['enter']){
- echo 'SIKERES BELÉPÉS<BR>';
- echo '<A href="?exit=on">KILÉPÉS</A><BR>';
- echo '<A HREF="?add=on">Létrehoz</A><BR>';
- $sql='SELECT nev as `user`, jelszo as `pass` FROM `user`';
- $result=mysqli_query($link,$sql);
- while($row=mysqli_fetch_assoc($result)){
- echo $row['user'].' | '.$row['pass'].'<a href="?mod=on&user='.$row['user'].'"Módosítás</a><BR>';
- }
- } else {
- echo '<FORM NAME="form1" action="8.het.php" method="POST">
- <INPUT TYPE="text" name="user">
- <INPUT TYPE="password" name="pass">
- <INPUT TYPE="submit" name="submit" value="BELEP">
- </FORM>';
- }
- mysqli_close($link);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement