Index du Forum » » Sécurité

Auteur

Problème de spam dans livre d'or
Anonyme
19853  

  Posté : 06-11-2006 21:43

Excusez-moi il y a eu un petit problème avec le HTML

Voici le code:


La source:
Fichier 1:
<?php

require "dv_config.php";

?>
<html>
<head>
<meta http-equiv=
"Content-Type" content="text/html; charset=iso-8859-1">
<title>-=Goatart=- Guestbook</title>
</head>

<body bgcolor=
"#003366" text="#CCCCCC" link="#CCCCCC" vlink="#CCCCCC" alink="#6699CC">
<table width=
"650" border="0" cellspacing="0" cellpadding="10">
<tr>
<td class=
"text" height="2"><p><a href="gbook/add_msg.php">Click here to add
a message</a></p>
<p>
<?php
        
        if (!isset($d))
            $d="0";
        if (!isset($f))
            $f=$d v_guest_page;

        $db = mysql_connect (
"$dv_host""$dv_login""$dv_pass") or die("Base de données indisponible");
        mysql_select_db(
"$dv_base",$db);

        $query = 
"
SELECT * FROM DVgbook ORDER BY da te DESC LIMIT ".$d."".$dv_guest_page."";
        $result = mysql_que ry($query) or die (
"<p align=center class=text>Lecture des&nbs p;messages sur le guestbook impossible</p>");
        $nb_result = mysql_ num_rows($result);
        
        $query_nb = 
"SELECT * FROM DVgbook";
        $result_nb = mysql_ query($query_nb) or die (
"");
        $nb_result_nb = mys ql_num_rows($result_nb);
        
        while ($row =  mysql_fetch_array($result)) 
{

            $mess age = $row
[message];
            $pseu do = $row
[pseudo];
            $emai l = $row
[email];
            $url& nbsp;= $row
[url];
            
            $date  = $row
[date];
            $anne e = date(
"Y", $date);
            $mois  = date(
"m", $date);
            $jour  = date(
"d", $date);
            $heur es = date(
"H", $date);
            $minu tes = date(
"i", $date);
            
            $date  = 
"Gepost op".$jour."/".$mois."/".$annee." om ".$heures."h".$minutes;

            echo& nbsp;
"<table width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" align=\"center\">\n";
            echo& nbsp;
"<tr bgcolor=\"#000066\"\n";
            echo& nbsp;
"<td width=\"80\" bgcolor=\"#993300\" align=\"left\">\n";
            echo& nbsp;
"$pseudo\n";
            echo& nbsp;
"<a href=\"mailto:".$email."\">Mail</a>\n";
            echo& nbsp;
"</td>\n";
            echo& nbsp;
"<td width=\"320\" bgcolor=\"#993300\" align=\"center\">\n";
            echo& nbsp;
"Website: <a href=\"".$url."\" target=\"_blank\">".$url."</a>\n";
            echo& nbsp;
"</td>\n";
            echo& nbsp;
"<td width=\"200\" bgcolor=\"#993300\" align=\"right\">\n";
            echo& nbsp;$date.
"</td>\n";
            echo& nbsp;
"</tr>\n"; ?>
<font color=
"#993300"& #62;___________________________________________________________________________ _
_______________</font>
<?
echo 
"<tr bgcolor=\"#CCCCCC\"\n";
echo 
"<td bgcolor=\"#003366\" colspan=\"3\">\n";
echo $message;
echo 
"</td>\n";
echo 
"</tr>\n";
echo 
"</table>\n";
echo 
"<br>\n";

}


mysql_close($db);

echo 
"<center>\n";

if ($d != 
"0"{
$d_new1 = $d-$dv_guest_page;
$f_new1 = $d;
echo 
"<a href=\"dv_gbook.php?d=$d_new1&f=$f_new1\"><< Vorige pagina</a> | \n";
}

$nb_pages = intval($nb_result_nb/$dv_guest_page)+1;

if ($nb_pages > 
"1"{

for ($i=0;$i<$nb_pages;$i++) 
{
if (isset($d_page))
$d_page = $d_page+$dv_guest_page;
else
$d_page = 
"0";
$f_page = $f_page+$dv_guest_page;
$num_page = $i+1;
if ($d==$d_page)
echo $num_page.
"\n";
else 
{
if ($d_page < $nb_result_nb)
echo 
"<a href=\"dv_gbook.php?d=$d_page&f=$f_page\">".$num_page."</a> \n";
}
}
}

if ($f < $nb_result_nb) 
{
$d_new2 = $f;
$f_new2 = $f+$dv_guest_page;
echo 
"| <a href=\"dv_gbook.php?d=$d_new2&f=$f_new2\">Volgende pagina >></a>\n";
}
?>
<br>
<a href=
"gbook/add_msg.php">Click here to add a message</a& gt;</center> </p></td>
</tr>
</table>
<br>
</body>
</html>


Fichier2:
<?php
/*********************************************************************/
/*            &nb sp;       Ajout message dans  Guestbook           &nbs p;         */
/*            &nb sp;    © Suprem ( suprem@free.fr ) - 2001           &n bsp;         */
/*********************************************************************/

require (
"../dv_config.php");

?>
<html>
<head>
<title>-=Guestbook=- Toevoegen van bericht</title>
<meta http-equiv=
"Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor=
"#003366" text="#000000" link="#CCCCCC" vlink="#CCCCCC" alink="#6699CC">
<form name=
"form" method="POST" action="do_msg.php">

<table width=
"650" border="0" cellspacing="0" cellpadding="10" height="59">
<tr>
<td valign=
"top" height="72">
<table width=
"600" border="0" cellspacing="0" cellpadding="3" align="center">
<tr bgcolor=
"#003366">
<td colspan=
"2" class="titre">
<div align=
"center"><img src="../../tekstafbeeldingen/eenberichttoevoegen.jpg" width="296" height="43"></div>
</td>
</tr>
<tr bgcolor=
"#DDDDDD">
<td width=
"90" height="141" valign="top" bgcolor="#003366"><font color="#CCCCCC" face="Geneva, Arial, Helvetica, sans-serif">Bericht:</font></td>
<td width=
"498" valign="top" height="141" bgcolor="#003366">
<div align=
"left">
<textarea name=
"message" cols="50" wrap="VIRTUAL" rows="6"></textarea>
</div>
</td>
</tr>
<tr bgcolor=
"#CCCCCC">
<td width=
"90" bgcolor="#003366"><font color="#CCCCCC" face="Geneva, Arial, Helvetica, sans-serif">Naam:</font></td>
<td width=
"498" valign="top" bgcolor="#003366">
<input type=
"text" name="pseudo" size="30" maxlength="30" class="box">
</td>
</tr>
<tr bgcolor=
"#DDDDDD">
<td width=
"90" bgcolor="#003366"><font color="#CCCCCC" face="Geneva, Arial, Helvetica, sans-serif">Email:</font></td>
<td width=
"498" valign="top" bgcolor="#003366">
<input type=
"text" name="email" size="30" maxlength="30" class="box">
</td>
</tr>
<tr bgcolor=
"#CCCCCC">
<td width=
"90" bgcolor="#003366"><font color="#CCCCCC" face="Geneva, Arial, Helvetica, sans-serif">Je
website:</font></td>
<td width=
"498" valign="top" bgcolor="#003366">
<input type=
"text" name="url" size="50" maxlength="255" class="box">
</td>
</tr>
<tr bgcolor=
"#003366">
<td height=
"22" colspan="2" valign="top">
<div align=
"center">
<input type=
"reset" name="Annuler" value="Wissen" class="bouton">
<input name=
"envoyer" type="submit" class="bouton" id="envoyer" value="Verstuur">
</div>
</td>
</tr>
</table>
<p align=
"center"><a href="../dv_gbook.php">Terug naar gastenboek</a></p>
</td>
</tr>
</table>
</form>
</body>
</html>





Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=21463&forum=12