voilà l'adresse de la page : http://www.molos.ch/mblog1.0/index.php
et l'adresse qui sert à ajouter les news : http://www.molos.ch/mblog1.0/add.php
Y a-t-il moyen de modifier le script pour éviter cela et si oui, comment ?
Merci d'avance !
Emma.

Code : Tout sélectionner
<?
// This script is copyright 2003 Robert Murdock.
// www.robscripts.com
?>
<HTML>
<HTML>
<HEAD>
<TITLE>Home - Blog Demo</TITLE>
<LINK REL=stylesheet HREF="scrollblanc.css" type="text/css">
<?
$DBhost = "localhost"; // Change this if needed. Default normally works.
$DBuser = "Emma"; // Change this to your db login name.
$DBpass = "xxxxxx"; // Change this to your db password.
$DBName = "MyMolos"; // Change this to the database name you use.
$table = "blogg"; // Change this to the table you use.
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to
connect to database");
@mysql_select_db("$DBName") or die("Unable to select
database $DBName");
$sqlquery = "SELECT * FROM $table ORDER BY pdate DESC";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
$i = 0;
if ($number < 1) {
print "<CENTER><P>There Were No Results for Your
Search</CENTER>";
}
else {
print "<center>";
while ($number > $i) {
$pdate = mysql_result($result,$i,"pdate");
$btext = mysql_result($result,$i,"btext");
?>
<body bgcolor="#dfdfdf">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse"
bgcolor="#dfdfdf" width="100%" height="101" id="AutoNumber1">
<tr>
<td width="438" height="101">
<center>
<table width="92%"
height="1" border="0" align="left" cellpadding="0" cellspacing="0" id="AutoNumber1"
style="border-collapse: collapse">
<tr>
<td width="98%" height="1" bgcolor="#dfdfdf">
<p align="left"></td>
</tr>
<tr>
<td width="98%" height="29" bgcolor="#dfdfdf">
<font face="Verdana"
color="#ff8000" size="-2"><b><?=$pdate?></b><hr align="center" size="1"><font face="Verdana"
color="#333333" size="-2"><?=$btext?></font>
</td>
</tr>
<tr>
<td width="98%" height="1" bgcolor="#dfdfdf">
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
</body>
<?
$i++;
}
print "</center>";
}
?>
</BODY>
</HTML>
Code : Tout sélectionner
<?
// This script is copyright 2003 Robert Murdock
// www.robscripts.com
?>
<HTML>
<HEAD>
<TITLE>Home - Add Blog</TITLE>
<?
$password = "xxxxxx"; // Change this to somthing only you know!
if ($dsp == "Yes") {
$pdate = date("D M d, Y H:i:s");
print "<br>Post Date: $pdate<BR>Text:<BR><BR>$btext";
print "<BR><BR>Do you want to submit this as shown (Hit
"back" on your browser to edit)?";
print "<form action=add.php METHOD=post>";
print "<input type=hidden NAME=dsp VALUE=Insert>";
print "<input TYPE=HIDDEN NAME=pdate VALUE='$pdate'>";
print "<input TYPE=HIDDEN NAME=btext VALUE='$btext'>";
print "<input TYPE=HIDDEN NAME=pass VALUE='$pass'>";
print "<input type=submit value=Submit></form>";
} else if ($dsp == "Insert") {
if ($pass == $password) {
print "<CENTER>Added.<CENTER><br>";
$DBhost = "localhost"; // Change this if needed. Default normally works.
$DBuser = "Emma"; // Change this to your db login name.
$DBpass = "xxxxxx"; // Change this to your db password.
$DBName = "MyMolos"; // Change this to the database name you use.
$table = "blogg"; // Change this to the table you use.
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "INSERT INTO $table (pdate,btext) VALUES('$pdate','$btext')";
$result = mysql_query($sqlquery);
} else {
print "Error: Invalid Password (pass: $password | pass2: $pass)";
}
} else {
?>
<form ACTION="add.php" METHOD="post">
<input type="hidden" NAME="dsp" value="Yes">
<p align="left">Add New blog:</p>
<table border="0">
<tr>
<td width="20%"><font face="Verdana" color="#ffffff">Message:</font></td>
<td witdh="80%"><textarea name="btext" rows="15" cols="60"></textarea></td>
</tr>
<tr>
<td width="20%"><font face="Verdana" color="#ffffff">Password:</font></td>
<td witdh="80%"><input TYPE="text" NAME="pass" size="30"></td>
</tr>
</table>
<input TYPE="SUBMIT" VALUE="Next >>">
<? } ?>
</BODY>
</HTML>
Code : Tout sélectionner
function formate_chaine($inputPost){
if (!get_magic_quotes_gpc()){
$chaine = mysql_escape_string($chaine);
};
return $chaine;
};
martin a écrit : Si tu n'y comprends rien, à mon avis cherche un autre script
Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 2 invités