|
Posted by Jean Pierre Daviau on 06/16/07 11:14
Hi everybody.
The email works fine and the echo lines works but I have this
warning:
You don't have permission to access
/<p>Nombre de personnes: 3</p><p>Jean<br>Non<br></p><p>1
courriels envoyés </p><p> </p>
on this server.
If I uncomment the if ($passe != "wsxqaz") the page does not
display proprerly.
=============================
<?php
function bureaudeposte($lius, $passe){
/*
if ($passe != "wsxqaz")
exit('Mauvais mot de passe');
*/
// Sujet
$subject = 'Bonjour ';
$message = "ok";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' .
"\r\n";
// Envoi
$db = mysql_pconnect("localhost", "root", "");
mysql_select_db("pierredata");
$query = "select * from demo_plein_air";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
echo "<p>Nombre de personnes: ".$num_results."</p>\n<p>";
$j = 0;
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
if (strstr($row["commentaire"], 'oui')){
$personne = $row["nom"];
mail($personne . '<'. $row["courriel"].'>',
$subject.$personne, $message, $headers);
$j++;
}
else
echo $row["nom"] . '<br>' ;
}
echo "</p>\n<p>$j courriels envoys $laius</p><p> </p>";
}
?>
<form action="<?php bureaudeposte($laius, $passe); ?>">
<input type="text" name="passe" value=""/>
<textarea name="laius" rows="20" cols="80"></textarea>
<input type="submit" value="Vaut mieux y penser une fois avant
de cliquer!" onClick="return confirm('Vaut mieux y penser deux
fois avant de cliquer!')" style="font-style:oblique;
background-color: transparent;"/>
</form>
================
--
Thanks for your attention.
Jean Pierre Daviau
--
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp
[Back to original message]
|