HTML-site forum


 · Forums · Reactie · Statistieken · Registreren · Zoeken · Regels · Tips · FAQ
HTML-site forum / PHP, ASP etc. / Span in gastenboek stoppen
Schrijver Bericht
3isico
Forum Lid

1 posts
# Geplaatst: 25 Jan 2010 09:45


Nu heb ik een jaar geleden een site gebouwd (www.felipe-muziek.nl) en alles was goed. Totdat ik gister bericht kreeg dat er gespammed wordt op het gastenboek. :(

Weet iemand hoe ik dat tegen kan gaan.
Alvast bedankt!!

PS: Het PHP gedeelte van het gastenboek bestaat uit 3 PHP-files.
*doorstuur.php
*lees.php
*schrijf.php
-----------------------------------------------------------------------
Dit is de inhoud van doorstuur.php:
<html>
<head>
<title>Gastenboek</title>

<script language="javascript">

function tijd()
{
setTimeout("lees()", 1500)
}
function lees()
{
document.location=("lees.php")
}

</script>


<?php

if(empty($_POST['naam']) || empty($_POST['bericht'])) {

echo("Je hebt je naam of bericht niet ingevuld <a href=schrijf.php>Klik hier</a> en probeer het nog eens");

} elseif (!isset($_POST['waar'])) {

echo("Je moet eerst iets invullen");

} else {

$naam=" ". $_POST['naam'] . " ";
$email=" ". $_POST['mail'] . " ";
$homepage=" ". $_POST['site'] . " ";
$bericht=" ". $_POST['bericht'] . " ";

$datum=date("d-m-Y");
$tijd=date("H:i");

function clean($naam, $email, $homepage, $bericht) {

$naam=strip_tags($naam);
$email=strip_tags($email);
$homepage=strip_tags($homepage);
$bericht=strip_tags($bericht);

$naam=htmlspecialchars($naam);
$email=htmlspecialchars($email);
$homepage=htmlspecialchars($homepage);
$bericht=htmlspecialchars($bericht);

return $naam;
return $email;
return $homepage;
return $bericht;

}

clean ($naam, $email, $homepage, $bericht);

$file = fopen ("gegevens.dat","a");
fputs ($file,"

<table width=460px cellpadding=0 cellspacing=0 border=0 margin=0px>
<tr height=10px width=450px border=0><td><FONT FACE=arial SIZE=1pt COLOR=white>$datum $tijd</FONT><br></td></tr>
<tr height=10px width=450px border=0><td><FONT FACE=arial SIZE=2pt COLOR=#434343><b>Naam:</b> $naam</FONT><br></td></tr>
<tr height=10px width=450px border=0><td><FONT FACE=arial SIZE=2pt COLOR=#434343><b>Email:</b> $email</FONT><br></td></tr>
<tr height=10px width=450px border=0><td><FONT FACE=arial SIZE=2pt COLOR=#434343><b>Homepage:</b> $homepage</FONT><br></td></tr>
<tr height=10px width=450px border=0><td><FONT FACE=arial SIZE=2pt COLOR=#434343><b>Bericht:</b> $bericht</FONT></td></tr>
<table width=460px height=7px><tr width=460px height=7px cellpadding=0 cellspacing=0 border=0><img src=Images/lijntje.jpg width=460px height=7px /></tr><td></td></table>
</table>
");

fclose($file);

}

?>
</head>
<body onLoad="tijd()" text="#434343" link="#EADA59" alink="#EADA59" vlink="#EADA59" face="arial" fontsize="3">
</body>
</html>

-----------------------------------------------------------------------
Dit is de php code van lees.php.
Deze code staat midden in een html bestand.

<?php

echo("<left>");

include("gegevens.dat");

?>
</div>
<div id="tekenen">
<a href="schrijf.php" target="_self">
<img src="Images/bt_sign_guestbook.jpg" name="teken" width="150" height="40" vspace="0" border="0" id="teken" /></a></div>
</div>
-----------------------------------------------------------------------
Dit is de php code in schrijf.php
Hier staat de php code verwerkt in een formulier

<div style= "position: relative; float: left; clear: left; width: 440px; height: 325px; z-index: 5; left: 250px; top: 265px;">
<!----------------------------------------------------------------------------------------------------------------------------------->
<form name="gastenboek" method="post" action="doorstuur.php">

<table width"479px" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="479px" height="40px">
<div align="right"><font face="arial" size="2" color="#434343">
* Naam: &nbsp</font></div> </td>

<td width="479px" height="40px">
<input type="text" name="naam" size="35" maxlength="70"> </td>
</tr>
<tr>
<td width="479px" height="40px">
<div align="right"><font face="arial" size="2" color="#434343">
Email: &nbsp</font></div> </td>
<td width="479px" height="40px">
<input type="text" name="mail" size="35" maxlength="100"> </td>
</tr>
<tr>
<td width="479px" height="40px">
<div align="right"><font face="arial" size="2" color="#434343">
Homepage: &nbsp</font></div>
<td width="479px" height="40px">
<input type="text" name="site" size="35" maxlength="100"> </td>
</tr>
<input type="hidden" name="waar">
<tr>
<td valign="top" width="479px" height="40px">
<div align="right"><font face="arial" size="2" color="#434343">
<br>* Bericht: &nbsp</font></div> </td>
<td width="479px" height="150px">
<textarea name="bericht" cols="27" rows="6" wrap="VIRTUAL"></textarea>
<font size=1 face="arial" color="#434343"><br>* Verplicht om in te vullen</font> </td>
</tr>
<tr>
<td colspan="2" width="479px" height="10px">
<div style= "margin-left: 138px; margin-top: 5px; align: left;"><font face="arial" size="2" color="#434343">
<input type="submit" name=submit value="Toevoegen" />
</font>&nbsp
<input type="reset" value="Invoer wissen">
</font></font> </div> </td>
</tr>
</table>
</form>
</div>
<div id="kader"></div>
<div id="lees"><a href="lees.php"><img src="Images/bt_lees_guestbook.jpg" border="0" /></a></div>
</body>
</html>

 
egaTniv
Forum Lid

3780 posts
# Geplaatst: 25 Jan 2010 09:49


Maak er een captcha bij.

Superkluns
Forum Lid

751 posts
# Geplaatst: 25 Jan 2010 19:07


http://www.html-site.nl/forum/24_20232_0.html

Reactie

Tekst vet maken  Tekst cursief maken  Tekst onderstrepen  Afbeelding invoegen  Insert YouTube video  Link invoegen  html code invoeren  css code invoeren  php code invoeren   javascript code invoeren  Uitschakelen *Wat is dat?


» Naam  » Wachtwoord 
 Alleen geregistreerde bezoekers kunnen hier een bericht plaatsen. Je kunt inloggen of je hier registreren.

 



Dit forum is gebaseerd op miniBB © 2001-2010


Sponsor: BlueYellow

Sitemap