inlogsysteempje

Gesponsorde koppelingen

PHP script bestanden

  1. inlogsysteempje

« Lees de omschrijving en reacties

------------Login.php--------------------------------

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
    session_start();
?>


<html>
<head>
<title>Pagina titel</title>
<style type="text/css">
@import url(style.css);
 </style>
</head>

<script language="JavaScript">
 
if (self.parent.frames.length != 0) self.parent.location=document.location.href;
</script>
<body bgcolor="#000000">

<?php


if ($submit) {
    
    $check="1";
    

$user1 = "Je username :D";
$pass = "Passowrd";
$host = "localhost";
$dbdb = "website";


if (!mysql_select_db($dbdb, mysql_connect($host, $user1, $pass)))
{

    echo "Connectie met database mislukt.";
    exit();
}
      $user = addslashes($user);
        $password = addslashes($password);


$query = mysql_query("SELECT * FROM users WHERE user = '$user' AND password = '$password'");
    $results = mysql_num_rows($query);
    
echo "$results";


        if ($results == '1') {





$datum = date("d-m-Y H:i");



$ipadres = $REMOTE_ADDR;


$query = "INSERT INTO login (`id`, `user`, `ip`, `datum`) VALUES ('','$user','$ipadres','$datum')";
mysql_query($query);




    

            $login = "1";
            $userid = "$user$password";
            
        session_register("login");
        
        session_register("userid");
      

                        ?>

                        <meta http-equiv=refresh content=0;URL=index.php><?php //pagina voor de goede login
                                              

            
            
        }
        
        
        else {

?>
<meta http-equiv=refresh content=0;URL=fout.php><?php //pagina voor de foute login
                                      


        }
}

?>

<?php
if($check!='1') { ?>
<br><br><br><br>

<center><font class=text3>Titel !!!</font><br><br></center>
<center>
<table border=4 width="180" height="40" cellpadding="0" style="border-collapse: collapse" bordercolor="#000000" cellspacing="0" bordercolorlight="#0000FF" bordercolordark="#3333CC" bgcolor="#FF00FF">
<form method="post" action="login.php" >
<tr> <td width="180" height="30" bgcolor="#FF0000">
  <font class=text>Inloggen</font></td>        
</tr>
<tr> <td width="180" height="30">
  <font class=text>Gebruikersnaam:<br>
  <input type="text" name="user" size="20"></font></font></td>        
    </tr>
<tr>
  <td width="180" height="30" bgcolor="#FF9966" bordercolor="#000000" bordercolorlight="#0000FF" bordercolordark="#0000FF">
  <font class=text>Wachtwoord:<br>
  <input type="password" name="password" size="20"></font></font></td>
  
  <tr> <td width="180" height="30" bgcolor="#33CC33">
  <font class=text>
  <input type="submit" name="submit" value="Login" style="float: left">
  </td>
</center>
<br>
<br>
<br>





<?php
}
?>


</body>
</html>


------------------------------Check.php------------------------------------------
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
session_start();
$user1 = "Je username :D";
$pass = "Passowrd";
$host = "localhost";
$dbdb = "website";


if (!mysql_select_db($dbdb, mysql_connect($host, $user1, $pass)))
{

    echo "Connectie met database mislukt.";
    exit();
}
  

$query = mysql_query("SELECT * FROM users WHERE userid = '$userid'");
    $controleer = mysql_num_rows($query) ;
    
    
    $sql = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE userid = '$userid'"));
    $status = $sql->status;
if ($controleer != '1'){?>

<html>
<head>
<title>Geen rechten om hier te komen</title>
<style type=text/css>
@import url(/style.css);
</style>
</head>
<body bgcolor="#333366"><br><br><br><br>

<font class=text><center>Je hebt niet het recht hier te komen of je bent niet ingelogd.<br><br>
<a href=login.php style="text-decoration: none">
      <font class=text2>Klik hier om je in te loggen</font>
    </a></center></font>
 
</body>
</html>



<?php exit();}
?>


--------------------------Style.css---------------------------------------
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
.text {
color: white;
font-family: "Comic Sans MS";
font-size: 10pt;
}
.text3 {
color: white;
font-family: "Comic Sans MS";
font-size: 24pt;
}

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.