Hallo jongens
Vraag 1:
ik heb een foutje ik heb een antiflood script gemaakt heb ik in me systeem gebouwd alleen hij werkt niet?
hier is het script
Vraag 2:
Hoe kan ik hem beveiligen dat je geen html tags mag gebruiken?
Vraag 1:
ik heb een foutje ik heb een antiflood script gemaakt heb ik in me systeem gebouwd alleen hij werkt niet?
hier is het script
<!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" lang="nl" xml:lang="nl">
<head>
<title>Nieuwe weetjes? - 71boxes.nl</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<br/><br/><br/><br/><br/><br/><br/><br/>
<center>
<table>
<tr><td>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR] [COLOR= #007700]&& ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$aFouten[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]weetje[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt geen weetje ingevuld[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]er zijn wat fouten gevonden <br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Fi[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$Fi[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$Fi[/COLOR][COLOR= #007700]++)
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$Fi[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />Klik <a href="javascript:history.go(-1);">hier</a> om terug te gaan.[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$timeoutseconds[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]20[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$timestamp[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$timeout[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]$timeoutseconds[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM demo WHERE moment<$timeout AND ip="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sql_spam[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM demo WHERE ip="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_spam[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je mag maar 1 keer in de 5 minuten een weetje posten.<br /><a href=javascript:history.go(-1)>Ga terug</a>"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO demo (ip,moment) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO demo (weetje) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]weetje[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je hebt succesvol een weetje aangemaakt."[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<meta http-equiv="refresh" content="1;url=admin.php">[/COLOR][COLOR= #007700];
}
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<form method="post" action="">
weetje toevoegen:<br/>
<textarea name="weetje" rows="15" cols="35"/>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]weetje[/COLOR][COLOR= #007700]];[/COLOR] ?></textarea><br/>
<input type="submit" name="verzenden" value="verzenden">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
</td></tr>
</table>
© alle rechten voorbehouden - onderdeel van <A HREF="http://www.zubein.nl">zubein.nl</A>
</center>
</body>
</html> Vraag 2:
Hoe kan ik hem beveiligen dat je geen html tags mag gebruiken?



