forum> berichten verwijderen
hoi ik had een vraagje ik heb een forum en wil meerdere berichten tegelijk kunnen verwijderen dit lukt mij niet echt kan iemand me helpen?
- wat voor forum?
- hoe wil je ze verwijderen? mysql? admin?
- we willen code zien of een structuur zien..
topic.php (alleen het stuk tussen <form></form>)
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
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
<form name="form2" method="post" action="delreactie.php">
<INPUT type=hidden value=<?php echo $nick ?> name=nick>
<INPUT type=hidden value=<?php echo $forumid ?> name=forumid>
<INPUT type=hidden value=<?php echo $topicid ?> name=topicid>
<TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
<TBODY>
<tr>
<TD align=right
background="images/mftop.gif" class="style4"><FONT size=1><u><b><?php echo $topic ?></b></u> </FONT>
</tr>
<tr>
<TD>
<TABLE cellSpacing=0 cellPadding=1 width="100%"
bgColor=black border=0>
<TBODY>
<TR>
<TD height="22">
<TABLE cellSpacing=0 cellPadding=1 width="546"
bgColor=white border=0>
<TBODY>
<?php
$sql = "SELECT * FROM toto_reactie WHERE topicid = '$topicid' ORDER BY id ASC";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
while ($row = mysql_fetch_array($res))
{
$row[nick] = htmlentities($row[nick]);
$row[nick] = nl2br($row[nick]);
?>
<TR bgcolor="#CCCCCC">
<TD colspan="2"><?php if ($staff == '1') {
?><input name="dell" type="checkbox" id="dell" value="<?php echo $row[ID] ?>">
<?php
}
?><?php if ($staff == '2') {
?><input name="dell" type="checkbox" id="dell" value="<?php echo $row[ID] ?>">
<?php
}
?><?php if ($staff == '3') {
?><input name="dell" type="checkbox" id="dell" value="<?php echo $row[ID] ?>">
<?php
}
?><?php if ($staff == '0') {
if ($nick == $moderator) {
?><input name="dell" type="checkbox" id="dell" value="<?php echo $row[ID] ?>">
<?php
}
}
?><a href="profiel.php?login=<?php echo $row[nick] ?>"><b><?php echo $row[nick] ?></b></a></TD>
<TD width="300" colspan="2"><div align="right"><?php echo $row[tijd] ?></div></TD>
</TR>
<?php
$profiel = "SELECT * FROM toto_leden WHERE login = '$row[nick]'";
$prof = mysql_query($profiel);
$logo1 = mysql_result($prof, 0, logo);
$staff1 = mysql_result($prof, 0, staff);
$post1 = mysql_result($prof, 0, posts);
$punt1 = mysql_result($prof, 0, punten);
?>
<TR>
<TD width="86" bgcolor="#FFFFFF"><a href="profiel.php?login=<?php echo $row[nick] ?>"><img src="<?php echo $logo1 ?>"></a><br>
<?php
if ($staff1 == 1) { ?>
<span class="style11"><b><font size="2" color="#FF0000">ToTo Staff</font></b></span>
<?php } if ($staff1 == 3) { ?>
<span class="style11"><b><font size="2" color="#FF0000">ToTo Staff</font></b></span>
<?php } ?> <br>
<b><font size="1">Posts:</b><?php echo $post1 ?> </font>
<br>
<b><font size="1">Punten:</b><?php echo $punt1 ?> </font>
</TD>
<TD colspan="3"><?php echo $row[bericht] ?></TD>
</TR>
<?php
}
}
?>
</TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
</tr>
<tr>
<TD
background="images/mfbottom.gif"> </TD>
</tr><TR height=17>
<TD align=right><tr>
<TD align=right></tr>
</TBODY></TABLE>
<div align="left">
<input type="submit" name="Submit" value="verwijder">
</div>
</form>
<INPUT type=hidden value=<?php echo $nick ?> name=nick>
<INPUT type=hidden value=<?php echo $forumid ?> name=forumid>
<INPUT type=hidden value=<?php echo $topicid ?> name=topicid>
<TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
<TBODY>
<tr>
<TD align=right
background="images/mftop.gif" class="style4"><FONT size=1><u><b><?php echo $topic ?></b></u> </FONT>
</tr>
<tr>
<TD>
<TABLE cellSpacing=0 cellPadding=1 width="100%"
bgColor=black border=0>
<TBODY>
<TR>
<TD height="22">
<TABLE cellSpacing=0 cellPadding=1 width="546"
bgColor=white border=0>
<TBODY>
<?php
$sql = "SELECT * FROM toto_reactie WHERE topicid = '$topicid' ORDER BY id ASC";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
while ($row = mysql_fetch_array($res))
{
$row[nick] = htmlentities($row[nick]);
$row[nick] = nl2br($row[nick]);
?>
<TR bgcolor="#CCCCCC">
<TD colspan="2"><?php if ($staff == '1') {
?><input name="dell" type="checkbox" id="dell" value="<?php echo $row[ID] ?>">
<?php
}
?><?php if ($staff == '2') {
?><input name="dell" type="checkbox" id="dell" value="<?php echo $row[ID] ?>">
<?php
}
?><?php if ($staff == '3') {
?><input name="dell" type="checkbox" id="dell" value="<?php echo $row[ID] ?>">
<?php
}
?><?php if ($staff == '0') {
if ($nick == $moderator) {
?><input name="dell" type="checkbox" id="dell" value="<?php echo $row[ID] ?>">
<?php
}
}
?><a href="profiel.php?login=<?php echo $row[nick] ?>"><b><?php echo $row[nick] ?></b></a></TD>
<TD width="300" colspan="2"><div align="right"><?php echo $row[tijd] ?></div></TD>
</TR>
<?php
$profiel = "SELECT * FROM toto_leden WHERE login = '$row[nick]'";
$prof = mysql_query($profiel);
$logo1 = mysql_result($prof, 0, logo);
$staff1 = mysql_result($prof, 0, staff);
$post1 = mysql_result($prof, 0, posts);
$punt1 = mysql_result($prof, 0, punten);
?>
<TR>
<TD width="86" bgcolor="#FFFFFF"><a href="profiel.php?login=<?php echo $row[nick] ?>"><img src="<?php echo $logo1 ?>"></a><br>
<?php
if ($staff1 == 1) { ?>
<span class="style11"><b><font size="2" color="#FF0000">ToTo Staff</font></b></span>
<?php } if ($staff1 == 3) { ?>
<span class="style11"><b><font size="2" color="#FF0000">ToTo Staff</font></b></span>
<?php } ?> <br>
<b><font size="1">Posts:</b><?php echo $post1 ?> </font>
<br>
<b><font size="1">Punten:</b><?php echo $punt1 ?> </font>
</TD>
<TD colspan="3"><?php echo $row[bericht] ?></TD>
</TR>
<?php
}
}
?>
</TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
</tr>
<tr>
<TD
background="images/mfbottom.gif"> </TD>
</tr><TR height=17>
<TD align=right><tr>
<TD align=right></tr>
</TBODY></TABLE>
<div align="left">
<input type="submit" name="Submit" value="verwijder">
</div>
</form>
zoals je ziet zien de staff leden en moderators het checkbox om hem te verwijderen dit kunnen ze dus selecteren en op verwijder drukken dan moet hij het versturen naar:
dellreactie.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
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<?php
$nick = strip_tags($_POST["nick"]);
$dell = strip_tags($_POST["dell"]);
$topicid = strip_tags($_POST["topicid"]);
$forumid = strip_tags($_POST["forumid"]);
$host = "****";
$user = "****";
$pass = "****";
$db = "****";
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db);
$dapp_nieuws_SQL_insert = "DELETE FROM `toto_reactie` WHERE `ID` = '$dell'";
mysql_query($dapp_nieuws_SQL_insert);
?> <?php include('forums.php'); ?>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<?php
$nick = strip_tags($_POST["nick"]);
$dell = strip_tags($_POST["dell"]);
$topicid = strip_tags($_POST["topicid"]);
$forumid = strip_tags($_POST["forumid"]);
$host = "****";
$user = "****";
$pass = "****";
$db = "****";
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db);
$dapp_nieuws_SQL_insert = "DELETE FROM `toto_reactie` WHERE `ID` = '$dell'";
mysql_query($dapp_nieuws_SQL_insert);
?> <?php include('forums.php'); ?>
</body>
</html>
nu is het de bedoeling dat hij van de reacties in het 1e script meerdere tegelijk kan verwijderen nu doet hij er maar 1 :( hoe kan ik er voor zorgen dat hij meerdere verwijdert
tja dat wil ik ook weten
en ik ook nog steeds hoor