Parse error: parse error, unexpected $ in ... on line 82
te staan.
Ik snap echt niet wat die $ daar doet en op regel 85 staat helemaal niets.
Snapt iemand hier wat van of moet ik deze bug melden op php.net?
Groetjes
Rick
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
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
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
<?php
###################################
## PHPMYLOGON: A LOGIN SYSTEM ##
## (c) 2006 Jorik Berkepas ##
## Under the GNU GPL license ##
## [email protected] ##
###################################
// Include this file (safe_admin.php) to let a page only access by admins
include_once("../config.php");
include_once("../lang/lang_".$lang.".php");
include_once("../connect.php");
function sql_inj($value) {
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
if(version_compare(phpversion(),"4.3.0") == "-1") {
return mysql_escape_string($value);
} else {
return mysql_real_escape_string($value);
}
} // Deze functie is níet van mijzelf, ik dacht van Jan Koehoorn.
function get_ip () {
if (@getenv ($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = @getenv ($_SERVER['HTTP_X_FORWARDED_FOR']);
}
elseif (@getenv ($_SERVER['HTTP_CLIENT_IP'])) {
$ip = @getenv ($_SERVER['HTTP_CLIENT_IP']);
}
else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
} // Wederom Jan Koehoorn
if(isset($_SESSION['user_id'])) {
$ip = get_ip ($ip);
$sessie_ip = $_SESSION['user_ip'];
$cookie_ip = $_COOKIE['cookie_ip'];
$user_id = sql_inj($_SESSION['user_id']);
$sql = "SELECT ipadres
FROM `".$db_tbl."`
WHERE name='".$user_id."'";
$query = mysql_query($sql);
$count = mysql_num_rows($query);
if($count == 1) {
$row = mysql_fetch_object($query);
$dbip = htmlspecialchars($row->ipadres);
switch(true) {
case ($sessie_ip == $ip) && ($ip == $cookie_ip) && ($dbip == $sessie_ip) && ($dbip == $cookie_ip) && ($dbip == $ip):
// Login ok, set lastactive
$sql = "UPDATE `".$db_tbl."`
SET lastactive=NOW()
WHERE id='".$user_id."'";
mysql_query($sql);
switch($_SESSION['user_status']) {
case 1:
break;
default:
print $safeadmin_rights;
exit();
break;
}
default:
header("Location /login");
break;
}
}else{
echo $login_usererr;
}
}else{
header("Location /login");
?>
###################################
## PHPMYLOGON: A LOGIN SYSTEM ##
## (c) 2006 Jorik Berkepas ##
## Under the GNU GPL license ##
## [email protected] ##
###################################
// Include this file (safe_admin.php) to let a page only access by admins
include_once("../config.php");
include_once("../lang/lang_".$lang.".php");
include_once("../connect.php");
function sql_inj($value) {
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
if(version_compare(phpversion(),"4.3.0") == "-1") {
return mysql_escape_string($value);
} else {
return mysql_real_escape_string($value);
}
} // Deze functie is níet van mijzelf, ik dacht van Jan Koehoorn.
function get_ip () {
if (@getenv ($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = @getenv ($_SERVER['HTTP_X_FORWARDED_FOR']);
}
elseif (@getenv ($_SERVER['HTTP_CLIENT_IP'])) {
$ip = @getenv ($_SERVER['HTTP_CLIENT_IP']);
}
else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
} // Wederom Jan Koehoorn
if(isset($_SESSION['user_id'])) {
$ip = get_ip ($ip);
$sessie_ip = $_SESSION['user_ip'];
$cookie_ip = $_COOKIE['cookie_ip'];
$user_id = sql_inj($_SESSION['user_id']);
$sql = "SELECT ipadres
FROM `".$db_tbl."`
WHERE name='".$user_id."'";
$query = mysql_query($sql);
$count = mysql_num_rows($query);
if($count == 1) {
$row = mysql_fetch_object($query);
$dbip = htmlspecialchars($row->ipadres);
switch(true) {
case ($sessie_ip == $ip) && ($ip == $cookie_ip) && ($dbip == $sessie_ip) && ($dbip == $cookie_ip) && ($dbip == $ip):
// Login ok, set lastactive
$sql = "UPDATE `".$db_tbl."`
SET lastactive=NOW()
WHERE id='".$user_id."'";
mysql_query($sql);
switch($_SESSION['user_status']) {
case 1:
break;
default:
print $safeadmin_rights;
exit();
break;
}
default:
header("Location /login");
break;
}
}else{
echo $login_usererr;
}
}else{
header("Location /login");
?>
Gewijzigd op 01/01/1970 01:00:00 door Rick
( en ) ... en ... { en } tellen geeft meestal de oplossing.
Al gedaan, maar ik zal het nog een keer doen
Bumpen::
SanThe.