Zoek de fout
Omdat er helaas niet is gereageerd op mijn aanvraag heb ik geprobeerd zelf profielpagina's bij mijn loginsysteem te maken (PhpMyLogon). Aangezien ik een newbie ben in PHP heeft het mij veel moeite gekost dat te maken. Het is óf redelijk gelukt of ik heb er niets van gebakken. De code (profile.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
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
<?php
//Profielpagina's
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
if(isset($_GET['id'])) {
if(isset($_GET['name'])) {
$sql = "SELECT id,name FROM `".$db_tbl."` WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$dbid = htmlspecialchars($row->id);
?>
<table>
<tr>
<td><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><a href=\"?id=".$id."><font color=\"red\">".$name."</font></a></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td><a href=\"?id=".$id.">".$name."</a></td>\n";
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?php
if($query == TRUE) {
header("Location: profile.php?id=".$_GET['id']."");
echo "<table border=\"0\" width=\"500\">;
echo "<tr><td>Naam:</td><td>".$name."</td></tr>;
echo "<tr><td>Missie:</td><td>".$missie."</td></tr>;
echo "<tr><td>Ruimte:</td><td>".$ruimte."</td></tr>;
echo "<tr><td>Groep:</td><td>".$groep."</td></tr>;
echo "<tr><td>Stafflid:</td><td>".$stafflid."</td></tr>;
echo "</table>";
}else{
echo $error;
}
?>
<?
include("htmlbottom.php");
?>
//Profielpagina's
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
if(isset($_GET['id'])) {
if(isset($_GET['name'])) {
$sql = "SELECT id,name FROM `".$db_tbl."` WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$dbid = htmlspecialchars($row->id);
?>
<table>
<tr>
<td><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><a href=\"?id=".$id."><font color=\"red\">".$name."</font></a></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td><a href=\"?id=".$id.">".$name."</a></td>\n";
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?php
if($query == TRUE) {
header("Location: profile.php?id=".$_GET['id']."");
echo "<table border=\"0\" width=\"500\">;
echo "<tr><td>Naam:</td><td>".$name."</td></tr>;
echo "<tr><td>Missie:</td><td>".$missie."</td></tr>;
echo "<tr><td>Ruimte:</td><td>".$ruimte."</td></tr>;
echo "<tr><td>Groep:</td><td>".$groep."</td></tr>;
echo "<tr><td>Stafflid:</td><td>".$stafflid."</td></tr>;
echo "</table>";
}else{
echo $error;
}
?>
<?
include("htmlbottom.php");
?>
Ik weet dat er fouten in zitten, waarschijnlijk met name in het gedeelte if($query == TRUE). Dat heb ik er zonder reden tussen gegooid.. :)
Ik denk dat jullie het doel van de pagina wel snappen. Op de site www.mijnpagina.nl/profile.php staat een lijst van de gebruikers. Als je er een aanklikt, kom je op de profielpagina van de gebruiker met het bijbehorende id (vb.-url: www.mijnpagina.nl/profile.php?id=1).
O ja, nog één ding. Als ik de pagina uitprobeer, krijg ik de volgende error:
Parse error: syntax error, unexpected '>' in /storage... etc etc.
Iemand enig idee hoe dit op te lossen valt/of het op te lossen is? Bij voorbaat dank voor je reactie.
Met vriendelijke groet,
Cas
Gewijzigd op 01/01/1970 01:00:00 door Cas
Die error komt doordat je diverse echo's niet afsluit.
Gedaan, het is inderdaad wat duidelijker nu.
SanThe schreef op 13.09.2009 23:00:
Die error komt doordat je diverse echo's niet afsluit.
Regel 45 en verder. Zie de kleurtjes.
Gewijzigd op 01/01/1970 01:00:00 door - SanThe -
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
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
<?php
//Profielpagina's
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
if(isset($_GET['id'])) {
if(isset($_GET['name'])) {
$sql = "SELECT id,name FROM `".$db_tbl."` WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$dbid = htmlspecialchars($row->id);
?>
<table>
<tr>
<td><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><a href=\"?id=".$id."><font color=\"red\">".$name."</font></a></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td><a href=\"?id=".$id.">".$name."</a></td>\n";
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?php
if($query == TRUE) {
header("Location: profile.php?id=".$_GET['id']."");
echo "<table border=\"0\" width=\"500\">";
echo "<tr><td>Naam:</td><td>".$name."</td></tr>";
echo "<tr><td>Missie:</td><td>".$missie."</td></tr>";
echo "<tr><td>Ruimte:</td><td>".$ruimte."</td></tr>";
echo "<tr><td>Groep:</td><td>".$groep."</td></tr>";
echo "<tr><td>Stafflid:</td><td>".$stafflid."</td></tr>";
echo "</table>";
}else{
echo $error;
}
?>
<?
include("htmlbottom.php");
?>
//Profielpagina's
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
if(isset($_GET['id'])) {
if(isset($_GET['name'])) {
$sql = "SELECT id,name FROM `".$db_tbl."` WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$dbid = htmlspecialchars($row->id);
?>
<table>
<tr>
<td><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><a href=\"?id=".$id."><font color=\"red\">".$name."</font></a></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td><a href=\"?id=".$id.">".$name."</a></td>\n";
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?php
if($query == TRUE) {
header("Location: profile.php?id=".$_GET['id']."");
echo "<table border=\"0\" width=\"500\">";
echo "<tr><td>Naam:</td><td>".$name."</td></tr>";
echo "<tr><td>Missie:</td><td>".$missie."</td></tr>";
echo "<tr><td>Ruimte:</td><td>".$ruimte."</td></tr>";
echo "<tr><td>Groep:</td><td>".$groep."</td></tr>";
echo "<tr><td>Stafflid:</td><td>".$stafflid."</td></tr>";
echo "</table>";
}else{
echo $error;
}
?>
<?
include("htmlbottom.php");
?>
Daarnaast zou ik geen PhpMyLogon gebruiken.
Pepijn schreef op 14.09.2009 11:51:
Daarnaast zou ik geen PhpMyLogon gebruiken.
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
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
<?php
//Profielpagina's
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
if(isset($_GET['id'])) {
if(isset($_GET['name'])) {
$sql = "SELECT id,name FROM `".$db_tbl."` WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$dbid = htmlspecialchars($row->id);
?>
<table>
<tr>
<td><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><a href=\"?id=".$id."><font color=\"red\">".$name."</font></a></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td><a href=\"?id=".$id.">".$name."</a></td>\n";
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?php
if($query == TRUE) {
header("Location: profile.php?id=".$_GET['id']."");
echo "<table border=\"0\" width=\"500\">";
echo "<tr><td>Naam:</td><td>".$name."</td></tr>";
echo "<tr><td>Missie:</td><td>".$missie."</td></tr>";
echo "<tr><td>Ruimte:</td><td>".$ruimte."</td></tr>";
echo "<tr><td>Groep:</td><td>".$groep."</td></tr>";
echo "<tr><td>Stafflid:</td><td>".$stafflid."</td></tr>";
echo "</table>";
}else{
echo $error;
}
?>
<?
include("htmlbottom.php");
?>
//Profielpagina's
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
if(isset($_GET['id'])) {
if(isset($_GET['name'])) {
$sql = "SELECT id,name FROM `".$db_tbl."` WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$dbid = htmlspecialchars($row->id);
?>
<table>
<tr>
<td><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><a href=\"?id=".$id."><font color=\"red\">".$name."</font></a></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td><a href=\"?id=".$id.">".$name."</a></td>\n";
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?php
if($query == TRUE) {
header("Location: profile.php?id=".$_GET['id']."");
echo "<table border=\"0\" width=\"500\">";
echo "<tr><td>Naam:</td><td>".$name."</td></tr>";
echo "<tr><td>Missie:</td><td>".$missie."</td></tr>";
echo "<tr><td>Ruimte:</td><td>".$ruimte."</td></tr>";
echo "<tr><td>Groep:</td><td>".$groep."</td></tr>";
echo "<tr><td>Stafflid:</td><td>".$stafflid."</td></tr>";
echo "</table>";
}else{
echo $error;
}
?>
<?
include("htmlbottom.php");
?>
Daarnaast zou ik geen PhpMyLogon gebruiken.
Edit: Ik heb nu de code aangepast. Ik krijg nu de error:
Parse error: syntax error, unexpected $end in /storage... etc etc.
Wat zit er nu fout? Ik ga nog even kijken, indien iemand het weet, graag een reactie!
@Pepijn: Waarom geen PhpMyLogon gebruiken?
Cas
Gewijzigd op 01/01/1970 01:00:00 door Cas
@Cas: Ik gok op veroudering... Anyway, waarom gebruik je mysql_fetch_object() als ik vragen mag? Waarom allemaal dat ge-htmlspecialchars()? Ohja, en de backtics mogen uit je query :).
( => 20
) => 20
{ => 7
} => 5
[ => 4
] => 4
' => 11
" => 78
Heb niet veel kennis van php maar heb geprobeerd de profielpagina te bouwen. Dat deed ik door 2 codes te combineren, nl. :
Lijst van gebruikers:
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
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
<?php
###################################
## PHPMYLOGON: A LOGIN SYSTEM ##
## (c) 2006 Jorik Berkepas ##
## Under the GNU GPL license ##
## [email protected] ##
###################################
// Overzicht van alle members
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
?>
<table>
<tr>
<d><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"red\">".$name."</font></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?
include("htmlbottom.php");
?>
###################################
## PHPMYLOGON: A LOGIN SYSTEM ##
## (c) 2006 Jorik Berkepas ##
## Under the GNU GPL license ##
## [email protected] ##
###################################
// Overzicht van alle members
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
?>
<table>
<tr>
<d><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"red\">".$name."</font></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?
include("htmlbottom.php");
?>
Pagina om account te activeren (aangezien deze pagina met id's werkt dacht ik er wat aan te hebben).
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
106
107
108
109
110
111
112
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
<?php
###################################
## PHPMYLOGON: A LOGIN SYSTEM ##
## (c) 2006 Jorik Berkepas ##
## Under the GNU GPL license ##
## [email protected] ##
###################################
// Page for account activation after password reset or registration
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
if(isset($_GET['id'])) {
if(isset($_GET['code'])) {
$sql = "SELECT id,actcode,active FROM `".$db_tbl."` WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$dbid = htmlspecialchars($row->id);
$dbcode = htmlspecialchars($row->actcode);
$active = htmlspecialchars($row->active);
if($active == 0) {
if($dbcode == $_GET['code']) {
if(isset($_GET['activate'])) {
// Activate after password reset; remain old password (false password reset)
$sql = "UPDATE `".$db_tbl."` SET active=1,actcode='' WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
if($query == TRUE) {
echo $activate_pass;
}else{
echo $error;
}
}elseif(isset($_GET['registration'])) {
// Activate after registration
$sql = "UPDATE `".$db_tbl."` SET active=1,actcode='' WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
if($query == TRUE) {
echo $activate_reg;
}else{
echo $error;
}
}else{
if(isset($_POST['submit'])) {
// Execute
if($_POST['pass1'] == $_POST['pass2']) {
$md5pass = md5($_POST['pass1']);
$sql = "UPDATE `".$db_tbl."` SET password='".$md5pass."',active=1,actcode='' WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
if($query == TRUE) {
echo $activate_pass2;
}else{
echo $error;
}
}else{
echo $activate_pascheck;
}
}else{
// Form password change
?>
<form method="post" action="activate.php?id=<?= $_GET['id'] ?>&code=<?= $_GET['code'] ?>">
<table>
<tr>
<td><label for="pass1"><?= $activate_newpass ?>:</label></td><td><input id="pass1" type="password" name="pass1" /></td>
</tr>
<tr>
<td><label for="pass2"><?= $activate_repeat ?>:</label></td><td><input id="pass2" type="password" name="pass2" /></td>
</tr>
<tr>
<td></td><td><input type="submit" name="submit" value="<?= $activate_chngpass ?>" /></td>
</tr>
</table>
</form>
<?
}
}
}else{
echo $activate_falsecode;
}
}else{
echo $activate_nodeactivate;
}
}else{
header("Location: activate.php?uid=".$_GET['id']."");
}
}else{
// Formulier
?>
<form method="get" action="activate.php" >
<table>
<tr>
<td><label for="id"><?= $activate_userid ?>:</label></td><td><input type="text" id="id" name="id" maxlength="5" <? if(isset($_GET['uid'])) { echo "value=\"".$_GET['uid']."\""; } ?>/></td>
</tr>
<tr>
<td><label for="code"><?= $activate_actcode ?>:</label></td><td><input id="code" type="text" name="code" maxlength="15" /></td>
</tr>
<tr>
<td align="right"><input id="activate" type="checkbox" name="activate" value="yes" style="border: 0px" /></td><td><label for="activate"><?= $activate_keepcurrentpas ?></label></td>
</tr>
<tr>
<td></td><td><input type="submit" value="<?= $activate_act ?>" /></td>
</tr>
</table>
</form>
<?
}
include("htmlbottom.php");
?>
###################################
## PHPMYLOGON: A LOGIN SYSTEM ##
## (c) 2006 Jorik Berkepas ##
## Under the GNU GPL license ##
## [email protected] ##
###################################
// Page for account activation after password reset or registration
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
if(isset($_GET['id'])) {
if(isset($_GET['code'])) {
$sql = "SELECT id,actcode,active FROM `".$db_tbl."` WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$dbid = htmlspecialchars($row->id);
$dbcode = htmlspecialchars($row->actcode);
$active = htmlspecialchars($row->active);
if($active == 0) {
if($dbcode == $_GET['code']) {
if(isset($_GET['activate'])) {
// Activate after password reset; remain old password (false password reset)
$sql = "UPDATE `".$db_tbl."` SET active=1,actcode='' WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
if($query == TRUE) {
echo $activate_pass;
}else{
echo $error;
}
}elseif(isset($_GET['registration'])) {
// Activate after registration
$sql = "UPDATE `".$db_tbl."` SET active=1,actcode='' WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
if($query == TRUE) {
echo $activate_reg;
}else{
echo $error;
}
}else{
if(isset($_POST['submit'])) {
// Execute
if($_POST['pass1'] == $_POST['pass2']) {
$md5pass = md5($_POST['pass1']);
$sql = "UPDATE `".$db_tbl."` SET password='".$md5pass."',active=1,actcode='' WHERE id='".$_GET['id']."'";
$query = mysql_query($sql);
if($query == TRUE) {
echo $activate_pass2;
}else{
echo $error;
}
}else{
echo $activate_pascheck;
}
}else{
// Form password change
?>
<form method="post" action="activate.php?id=<?= $_GET['id'] ?>&code=<?= $_GET['code'] ?>">
<table>
<tr>
<td><label for="pass1"><?= $activate_newpass ?>:</label></td><td><input id="pass1" type="password" name="pass1" /></td>
</tr>
<tr>
<td><label for="pass2"><?= $activate_repeat ?>:</label></td><td><input id="pass2" type="password" name="pass2" /></td>
</tr>
<tr>
<td></td><td><input type="submit" name="submit" value="<?= $activate_chngpass ?>" /></td>
</tr>
</table>
</form>
<?
}
}
}else{
echo $activate_falsecode;
}
}else{
echo $activate_nodeactivate;
}
}else{
header("Location: activate.php?uid=".$_GET['id']."");
}
}else{
// Formulier
?>
<form method="get" action="activate.php" >
<table>
<tr>
<td><label for="id"><?= $activate_userid ?>:</label></td><td><input type="text" id="id" name="id" maxlength="5" <? if(isset($_GET['uid'])) { echo "value=\"".$_GET['uid']."\""; } ?>/></td>
</tr>
<tr>
<td><label for="code"><?= $activate_actcode ?>:</label></td><td><input id="code" type="text" name="code" maxlength="15" /></td>
</tr>
<tr>
<td align="right"><input id="activate" type="checkbox" name="activate" value="yes" style="border: 0px" /></td><td><label for="activate"><?= $activate_keepcurrentpas ?></label></td>
</tr>
<tr>
<td></td><td><input type="submit" value="<?= $activate_act ?>" /></td>
</tr>
</table>
</form>
<?
}
include("htmlbottom.php");
?>
Zoals je ziet heb ik gewoon delen van bovenstaande codes gekopieerd en aangepast in hoeverre ik dat nodig achtte. Misschien geen slimme zet.. Maar ik moet wat ;)
Cas
SanThe schreef op 14.09.2009 15:23:
Je sluit niet alles af.
( => 20
) => 20
{ => 7
} => 5
[ => 4
] => 4
' => 11
" => 78
( => 20
) => 20
{ => 7
} => 5
[ => 4
] => 4
' => 11
" => 78
Kzal het allemaal wel aanpassen en dan zien wat er gebeurt.
Bedankt!
Cas
Gelieve Niet Bumpen::
Gewijzigd op 01/01/1970 01:00:00 door Cas
PhpMyLogon is verouderd, de maker hiervan raad mensen ook aan om dit vooral NIET te gebruiken :)
Chris Kortaan schreef op 14.09.2009 15:30:
PhpMyLogon is verouderd, de maker hiervan raad mensen ook aan om dit vooral NIET te gebruiken :)
Oké dan.. Misschien is het dan beter wat anders te zoeken.
Ennuh, wat is dan een concrete reden het niet te gebruiken? Onveilig ofzo?
Cas
http://phphulp.vindme.nl/
Beetje aanpassen aan de hand van wat tutorials en je komt al een flink stuk op weg.
- SALT erin bouwen bij het wachtwoord.
- Alle exits vervangen door een nettere fouten afhandeling.
Tip: Beetje aanpassen aan de hand van wat tutorials en je komt al een flink stuk op weg.
- SALT erin bouwen bij het wachtwoord.
- Alle exits vervangen door een nettere fouten afhandeling.
@SanThe: Inderdaad, het is een ; vergeten in regel 3 (line 4 is witregel). Ik heb bruin haar dus daar kan het niet aan liggen.. ;)
Cas
Gewijzigd op 01/01/1970 01:00:00 door Cas
Puntkomma op regel 4 vergeten?
Code: home.php
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
include(headers/database.php);
$data = mysql_query("SELECT * FROM `memb_userlist`") or die(mysql_error());
$info = mysql_fetch_array( $data );
header('Location: ?" . $info['user_name'] . "');
while($info = mysql_fetch_array( $data ))
{
echo "<b>Naam:</b> " . $info['user_name'] . " ";
echo "<b>ID:</b> " . $info['user_id'] . " <br>";
}
?>
include(headers/database.php);
$data = mysql_query("SELECT * FROM `memb_userlist`") or die(mysql_error());
$info = mysql_fetch_array( $data );
header('Location: ?" . $info['user_name'] . "');
while($info = mysql_fetch_array( $data ))
{
echo "<b>Naam:</b> " . $info['user_name'] . " ";
echo "<b>ID:</b> " . $info['user_id'] . " <br>";
}
?>
Doel van de code is om de gegevens te kunnen zien op de site www.mijnwebsite.nl/home.php?[gebruikersnaam]. Daarom heb ik header('Location: ?" . $info['user_name'] . "'); ingevuld; blijkbaar geeft dit problemen.
Opnieuw de vraag: Wat doe ik fout?
Bij voorbaat dank voor je reactie.
Cas
Gewijzigd op 01/01/1970 01:00:00 door Cas