Check pagina (check.php)
Gesponsorde koppelingen
PHP script bestanden
Code (php)
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
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
<?php
session_start();
if(!isset($_SESSION['session_id'])){
header("location: " . 'login.php?error=nosess');
}
include 'conn.php';
$q1 = "
SELECT
id
FROM
sessions
WHERE
session_id = '".$_SESSION['session_id']."'
AND
user_ip = '".$_SERVER['REMOTE_ADDR']."'
AND
user_id = '".$_SESSION['user_id']."'
";
if(!$r1 = $Mysqli->query($q1))
{
echo 'Er is een fout opgetreden!. '. $Mysqli->error;
}
elseif($Mysqli->affected_rows == 0)
{
//sessie niet gevonden
header("location: " . 'login.php?error=sess');
}
?>
session_start();
if(!isset($_SESSION['session_id'])){
header("location: " . 'login.php?error=nosess');
}
include 'conn.php';
$q1 = "
SELECT
id
FROM
sessions
WHERE
session_id = '".$_SESSION['session_id']."'
AND
user_ip = '".$_SERVER['REMOTE_ADDR']."'
AND
user_id = '".$_SESSION['user_id']."'
";
if(!$r1 = $Mysqli->query($q1))
{
echo 'Er is een fout opgetreden!. '. $Mysqli->error;
}
elseif($Mysqli->affected_rows == 0)
{
//sessie niet gevonden
header("location: " . 'login.php?error=sess');
}
?>