kan niet inloggen
Ik heb een eigen server opgezet van netplay plus 2.0 en alles werkt server staat online enz.. alleen als ik me registeer dan krijg ik een link gestuurd om me account te activeren en dan is er een probleem.. dan druk ik op die link en dan moet ie met het scherm aankomen: Validation Completed! Enjoy and see you in game! en dan zet ie in de DB bij users bij validation +1 maar dat doet ie dus niet en worden de accounts niet geactiveert.. waar ligt het aan?
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Thanks !</title>
</head>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Thanks !</title>
</head>
Succes.php
<body>
<p>Thanks for your registration!!</p>
<p>An email have been sended to confirm your registration and validate your email adress.</p>
<p>You can not play if your email is not validated.</p>
</body>
</html>
Confirm.php
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php require_once('Connections/Netplay.php'); ?>
<?php
mysql_select_db($database_netplay, $netplay);
$code = $_GET['confirm'];
$id = $_GET['id'];
$query = "SELECT * FROM temp_users where id = ".$id." AND code='".$code."';";
$Result1 = mysql_query($query, $Netplay) or die(mysql_error());
if(mysql_num_rows($Result1)>0)
{
$row = mysql_fetch_row($Result1);
$query = "UPDATE users SET validation=1 where id = ".$id.";";
$Result1 = mysql_query($query, $Netplay) or die(mysql_error());
$query = "DELETE FROM temp_users where id = ".$id.";";
$Result1 = mysql_query($query, $Netplay) or die(mysql_error());
echo "Validation Completed! Enjoy and see you in game!";
}
else
echo "Error : The Confirmation code or the id are wrong or not found.";
?>
<?php
mysql_select_db($database_netplay, $netplay);
$code = $_GET['confirm'];
$id = $_GET['id'];
$query = "SELECT * FROM temp_users where id = ".$id." AND code='".$code."';";
$Result1 = mysql_query($query, $Netplay) or die(mysql_error());
if(mysql_num_rows($Result1)>0)
{
$row = mysql_fetch_row($Result1);
$query = "UPDATE users SET validation=1 where id = ".$id.";";
$Result1 = mysql_query($query, $Netplay) or die(mysql_error());
$query = "DELETE FROM temp_users where id = ".$id.";";
$Result1 = mysql_query($query, $Netplay) or die(mysql_error());
echo "Validation Completed! Enjoy and see you in game!";
}
else
echo "Error : The Confirmation code or the id are wrong or not found.";
?>
index.php
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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
<?php require_once('Connections/Netplay.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO users (id, login, password, email, reg_dat, validation) VALUES ('', %s, MD5(%s), %s, UNIX_TIMESTAMP(), 0);",
GetSQLValueString($_POST['login'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['email'], "text"));
mysql_select_db($database_Netplay, $Netplay);
$Result1 = mysql_query($insertSQL, $Netplay) or die(mysql_error());
$id = mysql_insert_id();
$insertSQL = "INSERT INTO temp_users (id,email,code) VALUES (".$id.",'".$_POST['email']."',MD5('".$_POST['email']."') );";
$Result2 = mysql_query($insertSQL, $Netplay) or die(mysql_error());
$message="Thank you ".$_POST['login']." for your registration on the Netplay Server.\n Please click on this link to confirm your email adress : \n
http://localhost".$_SERVER['PHP_SELF']."/confirm.php?id=".$id."&confirm=".md5($_POST['email'])." \n";
$headers="From: [email protected]\n";
mail($_POST['email'],"Netplay: Confirm your email",$message,$headers);
$insertGoTo = "success.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_Netplay, $Netplay);
$query_User = "SELECT * FROM users";
$User = mysql_query($query_User, $Netplay) or die(mysql_error());
$row_User = mysql_fetch_assoc($User);
$totalRows_User = mysql_num_rows($User);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Register!</title>
</head>
<body>
<div align="center">
<p>Netplay Registration Page</p>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Login:</td>
<td><input type="text" name="login" value="" size="10" maxlength="8">
8 characters maximum</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Password:</td>
<td><input type="password" name="password" value="" size="10" maxlength="8">
8 characters maximum</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Email:</td>
<td><input type="text" name="email" value="" size="50" maxlength="255"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Register"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</div>
</body>
</html>
<?php
mysql_free_result($User);
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO users (id, login, password, email, reg_dat, validation) VALUES ('', %s, MD5(%s), %s, UNIX_TIMESTAMP(), 0);",
GetSQLValueString($_POST['login'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['email'], "text"));
mysql_select_db($database_Netplay, $Netplay);
$Result1 = mysql_query($insertSQL, $Netplay) or die(mysql_error());
$id = mysql_insert_id();
$insertSQL = "INSERT INTO temp_users (id,email,code) VALUES (".$id.",'".$_POST['email']."',MD5('".$_POST['email']."') );";
$Result2 = mysql_query($insertSQL, $Netplay) or die(mysql_error());
$message="Thank you ".$_POST['login']." for your registration on the Netplay Server.\n Please click on this link to confirm your email adress : \n
http://localhost".$_SERVER['PHP_SELF']."/confirm.php?id=".$id."&confirm=".md5($_POST['email'])." \n";
$headers="From: [email protected]\n";
mail($_POST['email'],"Netplay: Confirm your email",$message,$headers);
$insertGoTo = "success.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_Netplay, $Netplay);
$query_User = "SELECT * FROM users";
$User = mysql_query($query_User, $Netplay) or die(mysql_error());
$row_User = mysql_fetch_assoc($User);
$totalRows_User = mysql_num_rows($User);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Register!</title>
</head>
<body>
<div align="center">
<p>Netplay Registration Page</p>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Login:</td>
<td><input type="text" name="login" value="" size="10" maxlength="8">
8 characters maximum</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Password:</td>
<td><input type="password" name="password" value="" size="10" maxlength="8">
8 characters maximum</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Email:</td>
<td><input type="text" name="email" value="" size="50" maxlength="255"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Register"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</div>
</body>
</html>
<?php
mysql_free_result($User);
?>
netplay.php
Code (php)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_Netplay = "127.0.0.1";
$database_Netplay = "netplay";
$username_Netplay = "root";
$password_Netplay = "";
$Netplay = mysql_pconnect($hostname_Netplay, $username_Netplay, $password_Netplay) or trigger_error(mysql_error(),E_USER_ERROR);
?>
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_Netplay = "127.0.0.1";
$database_Netplay = "netplay";
$username_Netplay = "root";
$password_Netplay = "";
$Netplay = mysql_pconnect($hostname_Netplay, $username_Netplay, $password_Netplay) or trigger_error(mysql_error(),E_USER_ERROR);
?>
Wist niet welke ik moest posten dus deed ze maar ff allemaal,
Groetjes Nick,
Gewijzigd op 01/01/1970 01:00:00 door Nick Ven
niemand?
http://www.phphulp.nl/faq/#26
- Niet bumpen binnen 24 uur
- Alleen relevante code laten zien
- Goede topictitel
- Geen foutmelding