|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 envoyés $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 blique;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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Sat, 16 Jun 2007 13:14:20 +0200, Jean Pierre Daviau <Once@WasEno.ugh>
wrote: > <form action="<?php bureaudeposte($laius, $passe); ?>"> Nope, this is not how it works. <form action="<?php echo $SERVER['PHP_SELF']; ?>" method="post"> The 'action' attribute is where the form posts it's contents to, it's not a php function to be executed on the click. -- Rik Wasmus |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Jun 16, 3:55 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
> The 'action' attribute is where the form posts it's contents to, it's not > a php function to be executed on the click. > -- > Rik Wasmus And just to underline this, what you type in your HTML tags are just information for html -parser, which is client's browser. HTML or the client, does not know anything about php-scripts you've written. The php -functions you have are for php, and php alone. Therefore you post html to html, and according to what was posted, you execute php functions. -- Jussi Guy calls a government office, and proclaims "I want to be instated as the president!" He gets the reply "Are you an idiot, or just mentally ill?" The guy goes "Yes, yes! And I'm old, too!" disczero.com naamio.net hoffburger.com |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Thanks
|
|
![]() |
| Outils de la discussion | |
|
|