Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2354 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Livre d'or - Recherche d'un anti spam efficace

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Livre d'or - Recherche d'un anti spam efficace

n°1765096
zepouss
Posté le 25-07-2008 à 22:08:01  profilanswer
 

Bonjour à tout le monde.
 
Après avoir installer un livre d'or assez basique (mais difficile pour moi qui suis novice), je viens de me faire spammer, même en effaçant les messages dans ma bdd, j'ai l'impression que les spams arrivent au fur et à mesure, j'ai effacé 300 messages et il y en a toujours et il me semble que se sont les mêmes qui reviennent (même emails utilisés et même message)
 
Voici donc mon problème, j'aimerais insérer un captcha ou tout autre artifice pour stopper net les bots de spam.
 
Ma question est idiote : que dois-je insérer dans le code ci-dessous et que faire sur mon PHPmyAdmin ? Merci d'avance.
 
Voilà ci dessous le code de mon livre d'or :
 

Code :
  1. <?
  2.                                                                    
  3. /* connect to the database */                                 
  4. mysql_pconnect("$host","$user","$password" ) or die("Can't connect to the SQL-server" );
  5. mysql_select_db("$database" );                                                                             
  6. /* action=view : retrieve data from the database and show it to the user */                                                                             
  7. if($action == "view" ) {                                                                             
  8. /* function for showing the data */
  9. function search_it($name) {                                                     
  10.                                                                        
  11. /* some vars */                                                           
  12. global $offset,$total,$lpp,$dir,$records;                                             
  13. global $table,$html_mail,$admin_name,$admin_mail;
  14.                                                                                                                                    
  15. /* select the data to get out of the database */ 
  16. $query = "SELECT * FROM $table ORDER BY ID DESC";                                 
  17. $result = mysql_query($query);                                               
  18. $total= mysql_numrows($result);                                             
  19.        
  20. print "<CENTER><FONT FACE=\"Verdana\" SIZE=\"-2\"><A HREF=\"$scriptname?action=add\" onMouseOver=\"window.status='Add your name';return true\" onMouseOut=\"window.status='';return true\" TITLE=\"Add your name\">(Add your name)</A></FONT></CENTER><br><br>";   
  21.                                                                        
  22. if ($total== 0) {                                                           
  23. print "<CENTER>At the moment there are no persons in the guestbook.</CENTER><br><br>"; }                                                                           
  24. elseif ($total> 0) {                                                         
  25.      
  26. /* default */                                                             
  27. $counter=0;                                                               
  28. if ($dir=="" ) $dir="Next"; 
  29. $lpp = $records;
  30.                                      
  31. if ($offset==0) $offset=0;
  32.                                                
  33. if ($dir=="Next" ) {   
  34.                                                  
  35. if ($total > $lpp) { 
  36.                                                
  37. $counter=$offset;                                                   
  38. $offset+=$lpp;                                                     
  39. $num=$offset;                                                       
  40. if ($num > $total) {
  41. $num=$total; } }                                                                     
  42. else {                                                                 
  43. $num=$total; } }                                                     
  44. elseif ($dir=="Previous" ) {                           
  45. if ($total > $lpp) {                               
  46. $offset-=$lpp;
  47.                                  
  48. if ($offset < 0) {
  49. $offset=0; } 
  50.              
  51. $counter=$offset-$lpp;                         
  52. if ($counter < 0)
  53. $counter=0;                   
  54. $num=$counter+$lpp; }                                                 
  55. else {                                             
  56. $num=$total; } }                                                     
  57. while ($counter < $num) {                             
  58. $j=0;                                             
  59. $j=$counter + 1;
  60. /* now really grab the data */
  61. $i1=mysql_result($result,$counter,"name" );
  62. $i2=mysql_result($result,$counter,"email" );
  63. $i3=mysql_result($result,$counter,"job" );
  64. $i4=mysql_result($result,$counter,"comments" );
  65. $i4  =  stripslashes ("$i4" );
  66.  
  67. /* print it in a nice layout */     
  68. print "<CENTER>\n";
  69. print "<TABLE WIDTH=400 BORDER=0 ALIGN=CENTER VALIGN=TOP><TR><TD><FONT FACE=\"Verdana\" SIZE=\"-2\">\n";
  70. print "<HR>\n";
  71. print "<B>Name:</B> <A HREF=\"mailto:$i2\" onMouseOver=\"window.status='Email $i1';return true\" onMouseOut=\"window.status='';return true\" TITLE=\"Email $i1\">$i1</A>\n";
  72. print "<BR><B>Job:</B> $i3\n";
  73. print "<BR><B>Comment:</B>\n";
  74. print "<BR>$i4\n";
  75. print "</FONT></TD></TR></TABLE>\n";
  76. print "</CENTER>\n";
  77. $counter++;                                               
  78. }                                                               
  79. }                                                                 
  80. mysql_close();
  81. }                                                                   
  82.                                                                      
  83. /* execute the function */
  84. search_it($name);                                                   
  85.                                                                        
  86. /* See if we need to put on the NEXT or PREVIOUS buttons */         
  87. if ($total > $lpp) {                                                 
  88. echo("<form action=\"$scriptname?action=view\" method=\"POST\">\n" );           
  89.                                                                        
  90. /* See if we need a PREVIOUS button */                           
  91. if ($offset > $lpp) {                                             
  92. echo("<input type=\"submit\" value=\"Previous\" name=dir>\n" );  }                                                                 
  93.                                                                        
  94. /* See if we need a NEXT button */                               
  95. if ($offset < $total) {                                           
  96. echo("<input type=\"submit\" value=\"Next\" name=dir>\n" ); }                                                                 
  97.                                                                    
  98. echo("<input type=hidden name=\"offset\" value=\"$offset\">\n" ); 
  99. echo("<input type=hidden name=\"name\" value=\"$name\">\n" );     
  100. echo("</form>" );                                                 
  101. }                                                                   
  102. }
  103. /* action=add : show a form where the user can enter data to add to the database */
  104. elseif($action == "add" ) { ?>
  105. <FORM ACTION="<?php echo $scriptname; ?>?action=send" METHOD="POST">
  106. <TABLE CELLSPACING="2" ALIGN="CENTER">             
  107. <TR>
  108. <TD COLSPAN="3" ALIGN="LEFT">
  109. <B>Please take your time to enter something<BR>
  110. <CENTER><SMALL>[required fields are marked with *]</SMALL></CENTER></B><BR>
  111. </TD>
  112. </TR>
  113. <TR>
  114. <TD ALIGN="LEFT">Name</TD>
  115. <TD ALIGN="LEFT"><B>*</B></TD>
  116. <TD ALIGN="LEFT" NOWRAP>
  117. <INPUT TYPE="TEXT" NAME="form[name]">
  118. </TD>
  119. </TR>
  120. <TR>
  121. <TD ALIGN="LEFT">Job</TD>
  122. <TD ALIGN="LEFT"><B>*</B></TD>
  123. <TD ALIGN="LEFT" NOWRAP>
  124. <INPUT TYPE="TEXT" NAME="form[job]">
  125. </TD>
  126. </TR>
  127. <TR>
  128. <TD ALIGN="LEFT">Email</TD>
  129. <TD ALIGN="LEFT"><B>*</B></TD>
  130. <TD ALIGN="LEFT" NOWRAP>
  131. <INPUT TYPE="TEXT" NAME="form[email]">
  132. </TD>
  133. </TR>
  134. <TR>
  135. <TD ALIGN="LEFT">Comments</TD>
  136. <TD ALIGN="LEFT"><B>*</B></TD>
  137. <TD ALIGN="LEFT" NOWRAP>
  138. <TEXTAREA NAME="form[comments]" COLS="23" ROWS="8" WRAP="VIRTUAL"></TEXTAREA>
  139. </TD>
  140. </TR>
  141. <TR ALIGN="CENTER">
  142. <TD COLSPAN="3">
  143. <INPUT TYPE="SUBMIT" VALUE="Submit">&nbsp;<INPUT TYPE="RESET" VALUE="Reset">
  144. </TD>
  145. </TR>
  146. </TABLE>
  147. </FORM>
  148. <?
  149. }
  150. /* action=send : add the data from the user into the database */
  151. elseif($action == "send" ) {
  152. $reset = reset($required);
  153. while (list($key, $value) = each($required)) {
  154. if($form[$value] == "" ) {
  155. $count++;
  156. }
  157. if($count > 0) {
  158. ?>
  159. <FORM ACTION="<?php echo $scriptname; ?>?action=send" METHOD="POST">
  160. <TABLE CELLSPACING="2" ALIGN="CENTER">             
  161. <TR>
  162. <TD COLSPAN="3" ALIGN="LEFT">
  163. <B>Please take your time to enter something<BR>
  164. <CENTER><SMALL>[<FONT COLOR="red">you forgot some fields (marked with *)</FONT>]</SMALL></CENTER></B><BR>
  165. </TD>
  166. </TR>
  167. <TR>
  168. <TD ALIGN="LEFT">Name</TD>
  169. <TD ALIGN="LEFT"><B>*</B></TD>
  170. <TD ALIGN="LEFT" NOWRAP>
  171. <INPUT TYPE="TEXT" NAME="form[name]" VALUE="<?php echo $form[name]; ?>">
  172. </TD>
  173. </TR>
  174. <TR>
  175. <TD ALIGN="LEFT">Job</TD>
  176. <TD ALIGN="LEFT"><B>*</B></TD>
  177. <TD ALIGN="LEFT" NOWRAP>
  178. <INPUT TYPE="TEXT" NAME="form[job]" VALUE="<?php echo $form[job]; ?>">
  179. </TD>
  180. </TR>
  181. <TR>
  182. <TD ALIGN="LEFT">Email</TD>
  183. <TD ALIGN="LEFT"><B>*</B></TD>
  184. <TD ALIGN="LEFT" NOWRAP>
  185. <INPUT TYPE="TEXT" NAME="form[email]" VALUE="<?php echo $form[email]; ?>">
  186. </TD>
  187. </TR>
  188. <TR>
  189. <TD ALIGN="LEFT">Comments</TD>
  190. <TD ALIGN="LEFT"><B>*</B></TD>
  191. <TD ALIGN="LEFT" NOWRAP>
  192. <TEXTAREA NAME="form[comments]" COLS="23" ROWS="8" WRAP="VIRTUAL"><?php echo $form[comments]; ?></TEXTAREA>
  193. </TD>
  194. </TR>
  195. <TR ALIGN="CENTER">
  196. <TD COLSPAN="3">
  197. <INPUT TYPE="SUBMIT" VALUE="Submit">&nbsp;<INPUT TYPE="RESET" VALUE="Reset">
  198. </TD>
  199. </TR>
  200. </TABLE>
  201. </FORM>
  202. <? }
  203. else {
  204. if(!$form[email]) {
  205. $form[email] = "n/a"; }
  206. if(!$form[subject]) {
  207. $form[subject] = "n/a"; }
  208. if(!$form[name]) {
  209. $form[name] = "n/a"; }
  210. /* check if a HTML-mail should be send or a plain/text mail */
  211. if($html_mail == "yes" ) {
  212. mail("$admin_name <$admin_mail>","PHP3 Guestbook Addition","<HTML><BODY><FONT FACE=\"Century Gothic\"><TABLE BORDER=\"0\" WIDTH=\"100%\" CELLSPACING=\"4\"><TR>$form[name] ($form[email]) wrote the following message in the guestbook :</TR><TR><TD ALIGN=\"LEFT\">&nbsp;</TD><TD ALIGN=\"LEFT\" NOWRAP>&nbsp;</TD></TR><TR><TD ALIGN=\"LEFT\">$form[comments]</TD><TD ALIGN=\"LEFT\" NOWRAP>&nbsp;</TD></TR><TR><TD ALIGN=\"LEFT\">&nbsp;</TD><TD ALIGN=\"LEFT\" NOWRAP>&nbsp;</TD></TR><TR><TD ALIGN=\"LEFT\">Name:</TD><TD ALIGN=\"LEFT\" NOWRAP>$form[name]</TD></TR><TR><TD ALIGN=\"LEFT\">Beroep:</TD><TD ALIGN=\"LEFT\" NOWRAP>$form[job]</TD></TR><TR><TD ALIGN=\"LEFT\">Email:</TD><TD ALIGN=\"LEFT\" NOWRAP>$form[email]</TD></TR></TABLE></BODY></FONT></HTML>", "From: $form[name] <$form[email]>\nReply-To: $form[name] <$form[email]>\nContent-type: text/html\nX-Mailer: PHP/" . phpversion());
  213. }
  214. else {
  215. mail("$admin_mail","PHP3 Guestbook Addition","$form[name] ($form[email]) wrote the following message in the guestbook : \n\n $form[comments]\n\n Name: $form[name] \n Job: $form[job] \n Email: $form[email] \n", "From: $form[name] <$form[email]>\nReply-To: $form[name] <$form[email]>\nContent-type: text/plain\nX-Mailer: PHP/" . phpversion());
  216. }
  217. /* MySQL really hates it when you try to put things with ' or " characters into a database, so strip these...*/
  218. $form[comments]  =  addslashes ("$form[comments]" );
  219. $query = "INSERT INTO $table VALUES('','$form[name]', '$form[email]', '$form[job]', '$form[comments]')";
  220. $result = MYSQL_QUERY($query);
  221. ?>
  222. <BR><P ALIGN = CENTER>Thank you, <?php echo $form[name]; ?>, for adding your name to our guestbook.
  223. <BR><P ALIGN = CENTER><A  HREF="<?php echo $scriptname; ?>?action=view" onMouseOver="window.status='View your comment now';return true" onMouseOut="window.status='';return true" TITLE="View your comment now">View your comment now.</A><BR><BR>
  224. <?
  225. }                                                                   
  226. }
  227. /* if there's no action given, then we must show the main page */
  228. else {
  229. /* get the number of entries written into the guestbook*/
  230. $query = "SELECT name from $table";
  231. $result = MYSQL_QUERY($query);
  232. $number = MYSQL_NUMROWS($result);
  233.          
  234. if  ($number  == "" )  {
  235. $entry  =  "At the moment there are no persons"; }
  236. elseif  ($number  == "1" )  {
  237. $entry  = "At the moment there is 1 person"; }
  238. else  {
  239. $entry  = "At the moment there are $number persons"; }
  240. echo    "<CENTER><BR>";
  241. echo    "<P>$entry  in  the guestbook.<BR>";
  242. echo    "<H4><FONT FACE=\"Verdana\" SIZE=\"-2\"><A HREF=\"$scriptname?action=add\" onMouseOver=\"window.status='Add your name to our guestbook';return true\" onMouseOut=\"window.status='';return true\" TITLE=\"Add your name to our guestbook\">Add your name to our guestbook</A></FONT></H4>";
  243. if  ($number  > "" ) {
  244. echo    "<H4><FONT FACE=\"Verdana\" SIZE=\"-2\"><A HREF=\"$scriptname?action=view\" onMouseOver=\"window.status='View the names in our guestbook';return true\" onMouseOut=\"window.status='';return true\" TITLE=\"View the names in our guestbook\">View the names in our guestbook</A></FONT></H4>"; }
  245. echo    "</P></CENTER>";
  246. }
  247. ?>

mood
Publicité
Posté le 25-07-2008 à 22:08:01  profilanswer
 

n°1765133
Gf4x3443
Killing perfection
Posté le 26-07-2008 à 00:28:01  profilanswer
 

zepouss a écrit :

Ma question est idiote : que dois-je insérer dans le code ci-dessous et que faire sur mon PHPmyAdmin ? Merci d'avance.


 
Réponse toute aussi idiote: un captcha?
 
http://www.google.fr/search?hl=fr& [...] cher&meta=

n°1765267
zepouss
Posté le 26-07-2008 à 19:43:19  profilanswer
 

Merci pour ce commentaire ...
 
Bref, je pensais que quelqu'un me donnerait plus d'informations sur un captcha et comment l'insérer dans mon code.
 
J'ai tenté celui là : http://www.encaps.net/software/php-captcha/ mais sans succès.
 
1. J'ai bien créé le fichier captcha.php à la racine de mon serveur avec le code qui va bien, voici le code de la nouvelle page "captcha.php" :
 

Code :
  1. <?php
  2. session_start();
  3. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
  4. header("Last-Modified: " . gmdate("D, d M Y H:i:s" ) . " GMT" );
  5. header("Cache-Control: no-store, no-cache, must-revalidate" );
  6. header("Cache-Control: post-check=0, pre-check=0", false);
  7. header("Pragma: no-cache" );
  8. function _generateRandom($length=6)
  9. {
  10.     $_rand_src = array(
  11.         array(48,57) //digits
  12.         , array(97,122) //lowercase chars
  13. //        , array(65,90) //uppercase chars
  14.     );
  15.     srand ((double) microtime() * 1000000);
  16.     $random_string = "";
  17.     for($i=0;$i<$length;$i++){
  18.         $i1=rand(0,sizeof($_rand_src)-1);
  19.         $random_string .= chr(rand($_rand_src[$i1][0],$_rand_src[$i1][1]));
  20.     }
  21.     return $random_string;
  22. }
  23. $im = @imagecreatefromjpeg("captcha.jpg" );
  24. $rand = _generateRandom(3);
  25. $_SESSION['captcha'] = $rand;
  26. ImageString($im, 5, 2, 2, $rand[0]." ".$rand[1]." ".$rand[2]." ", ImageColorAllocate ($im, 0, 0, 0));
  27. $rand = _generateRandom(3);
  28. ImageString($im, 5, 2, 2, " ".$rand[0]." ".$rand[1]." ".$rand[2], ImageColorAllocate ($im, 255, 0, 0));
  29. Header ('Content-type: image/jpeg');
  30. imagejpeg($im,NULL,100);
  31. ImageDestroy($im);
  32. ?>


 
2. J'ai ensuite essayé d'intégrer les deux autres codes dans la page contenant le code du livre d'or mais je n'ai aucun captcha qui s'affiche, voici ici juste le code pour normalement afficher le captcha.
 

Code :
  1. <?php session_start() ?>


 
puis
 

Code :
  1. <?php
  2. if($_SESSION["captcha"]==$_POST["captcha"])
  3. {
  4.     //CAPTHCA is valid; proceed the message: save to database, send by e-mail ...
  5. }
  6. ?>


 
Bref, en ne vous mettant pas tout le code PHP du livre d'or je ne sais pas si vous allez trouver l'erreur ...
 
Merci.


Message édité par zepouss le 26-07-2008 à 22:55:33
n°1765299
zepouss
Posté le 26-07-2008 à 22:56:14  profilanswer
 

J'ai édité mon message.
 
Merci de vos réponses, pour information, après l'insertion du code captcha, je ne vois aucun affichage de captcha...

n°1765302
Gf4x3443
Killing perfection
Posté le 26-07-2008 à 23:17:47  profilanswer
 

Tu ne vois pas l'affichage dans un navigateur, mais est ce que le code y est (dans le source html généré) au moins?


Message édité par Gf4x3443 le 26-07-2008 à 23:17:52
n°1765304
zepouss
Posté le 26-07-2008 à 23:20:30  profilanswer
 

Oui, cf lignes 38, 39 et 40 qui renvoye normalement à l'image captcha et au fichier qui génère aléatoirement le captcha : captcha.php
 

Code :
  1. <?php session_start() ?>
  2. <FORM ACTION="<?php echo $scriptname; ?>?action=send" METHOD="POST">
  3. <TABLE CELLSPACING="2" ALIGN="CENTER">             
  4. <TR>
  5. <TD COLSPAN="3" ALIGN="LEFT">
  6. <span class="Style18"><B><BR>
  7. </B></span>
  8. <CENTER class="Style18 Style18">
  9.    <b><SMALL>Vous avez oubli&eacute; de renseigner un champ !</SMALL>       </b>
  10. </CENTER>
  11. <BR> </TD>
  12. </TR>
  13. <TR>
  14. <TD ALIGN="LEFT">Name</TD>
  15. <TD ALIGN="LEFT"><B>*</B></TD>
  16. <TD ALIGN="LEFT" NOWRAP>
  17. <INPUT TYPE="TEXT" NAME="form[name]" VALUE="<?php echo $form[name]; ?>"> </TD>
  18. </TR>
  19. <TR>
  20. <TD ALIGN="LEFT">Ville</TD>
  21. <TD ALIGN="LEFT"><B>*</B></TD>
  22. <TD ALIGN="LEFT" NOWRAP>
  23. <INPUT TYPE="TEXT" NAME="form[job]" VALUE="<?php echo $form[job]; ?>"> </TD>
  24. </TR>
  25. <TR>
  26. <TD ALIGN="LEFT">Email</TD>
  27. <TD ALIGN="LEFT"><B>*</B></TD>
  28. <TD ALIGN="LEFT" NOWRAP>
  29. <INPUT TYPE="TEXT" NAME="form[email]" VALUE="<?php echo $form[email]; ?>"> </TD>
  30. </TR>
  31. <TR>
  32. <TD ALIGN="LEFT">Commentaires</TD>
  33. <TD ALIGN="LEFT"><B>*</B></TD>
  34. <TD ALIGN="LEFT" NOWRAP>
  35. <TEXTAREA NAME="form[comments]" COLS="23" ROWS="8" WRAP="VIRTUAL"><?php echo $form[comments]; ?></TEXTAREA> </TD>
  36. </TR>
  37. <TR ALIGN="CENTER">
  38. <tr><td align="center">CAPTCHA:<br>
  39. (antispam code, 3 black symbols)<br>
  40. <table><tr><td><img src="captcha.php" alt="captcha image"></td><td><input type="text" name="captcha" size="3" maxlength="3"></td></tr>
  41. <TD COLSPAN="3">
  42. <INPUT TYPE="SUBMIT" VALUE="Submit">&nbsp;<INPUT TYPE="RESET" VALUE="Reset"> </TD>
  43. </TR>
  44. </TABLE>
  45. </FORM>
  46. <?php
  47. if($_SESSION["captcha"]==$_POST["captcha"])
  48. {
  49.     //CAPTHCA is valid; proceed the message: save to database, send by e-mail ...
  50. }
  51. ?>


Message édité par zepouss le 26-07-2008 à 23:21:41
n°1765305
Gf4x3443
Killing perfection
Posté le 26-07-2008 à 23:21:58  profilanswer
 

Non mais ca ok, c'est ton fichier php. Je demande le code html, après interprétation (vu tel que par navigateur).


Message édité par Gf4x3443 le 26-07-2008 à 23:22:09
n°1765307
zepouss
Posté le 26-07-2008 à 23:25:32  profilanswer
 

Ah non en effet il n'apparait pas d'où vient mon erreur ? Ci dessous le code interprété par le navigateur :
 

Code :
  1. <FORM ACTION="guestbook.php3?action=send" METHOD="POST">
  2. <TABLE width="295" ALIGN="CENTER" CELLSPACING="2">             
  3. <TR>
  4. <TD COLSPAN="3" ALIGN="LEFT"><strong>Jus de Framboise prendra note de vos commentaires :</strong><B><BR>
  5. <CENTER>
  6. </CENTER>
  7. </B></TD>
  8. </TR>
  9. <TR>
  10.   <TD ALIGN="LEFT">&nbsp;</TD>
  11.   <TD ALIGN="LEFT">&nbsp;</TD>
  12.   <TD ALIGN="LEFT" NOWRAP>&nbsp;</TD>
  13. </TR>
  14. <TR>
  15. <TD ALIGN="LEFT">Nom</TD>
  16. <TD ALIGN="LEFT">&nbsp;</TD>
  17. <TD ALIGN="LEFT" NOWRAP>
  18. <INPUT TYPE="TEXT" NAME="form[name]"> </TD>
  19. </TR>
  20. <TR>
  21. <TD ALIGN="LEFT">Ville</TD>
  22. <TD ALIGN="LEFT">&nbsp;</TD>
  23. <TD ALIGN="LEFT" NOWRAP>
  24. <INPUT TYPE="TEXT" NAME="form[job]"> </TD>
  25. </TR>
  26. <TR>
  27. <TD ALIGN="LEFT">Email</TD>
  28. <TD ALIGN="LEFT">&nbsp;</TD>
  29. <TD ALIGN="LEFT" NOWRAP>
  30. <INPUT TYPE="TEXT" NAME="form[email]"> </TD>
  31. </TR>
  32. <TR>
  33. <TD ALIGN="LEFT">Commentaires</TD>
  34. <TD ALIGN="LEFT">&nbsp;</TD>
  35. <TD ALIGN="LEFT" NOWRAP>
  36. <TEXTAREA NAME="form[comments]" COLS="23" ROWS="8" WRAP="VIRTUAL"></TEXTAREA> </TD>
  37. </TR>
  38. <TR ALIGN="CENTER">
  39. <TD COLSPAN="3">
  40. <INPUT TYPE="SUBMIT" VALUE="OK">
  41. &nbsp;<INPUT TYPE="RESET" VALUE="Reset"> </TD>
  42. </TR>
  43. </TABLE>
  44. </FORM>

n°1765383
zepouss
Posté le 27-07-2008 à 11:56:56  profilanswer
 

Le script de livre d'or fonctionne à merveille. Je suis absolument novice en PHP, je laisse donc passer toutes sortes de fautes.
 
Je désire simplement rajouter ce code de captcha tout simple mais qui pour moi est compliqué. Ce qui peut paraître être une évidence ne l'est pas pour moi.
 
Le commentaire ci-dessus ne m'aide en rien. Une erreur est pointé, le "$". J'en prends note mais cela ne me dit toujours pas quoi faire.
 
Si le code est bourré d'erreur très bien mais pour rappel, le livre d'or fonctionne bien sans ces lignes de codes de captcha que j'ai inséré. J'ai juste besoin d'ajouter ce code de captcha et si j'ai mal inséré ce code désolé mais la programmation à la base ce n'est pas du tout ma tasse de thé c'est pour cela que je demande une aide concrète.
 
Si quelqu'un désire m'aider je lui en serai fort reconnaissant, je ne doute pas que ta remarque ait été désobligeante Fred82 mais pour répondre à tes questions :
 
(i) non rien ne me choque car je suis novice
(ii) revoir les bases de PHP je veux bien mais cela ne m'apporte pas de solution claire dans l'immédiat ce qui est un but recherché quand on demande de l'aide sur un forum
 
Merci

Message cité 1 fois
Message édité par zepouss le 27-07-2008 à 12:00:12
n°1765418
Gf4x3443
Killing perfection
Posté le 27-07-2008 à 14:23:12  profilanswer
 

zepouss a écrit :


Si le code est bourré d'erreur très bien mais pour rappel, le livre d'or fonctionne bien sans ces lignes de codes de captcha que j'ai inséré. J'ai juste besoin d'ajouter ce code de captcha et si j'ai mal inséré ce code désolé mais la programmation à la base ce n'est pas du tout ma tasse de thé c'est pour cela que je demande une aide concrète.

 

C'est pas parce qu'il donne satisfaction en apparence que le fonctionnement est correct.

 

D'ailleurs, tu te heurtes toi même aux erreurs d'implémentation, insérer un captcha devient la croix et la bannière.

 
Citation :

(ii) revoir les bases de PHP je veux bien mais cela ne m'apporte pas de solution claire dans l'immédiat ce qui est un but recherché quand on demande de l'aide sur un forum

 

La solution claire, c'est revoir ton code. Ca suinte de nitroglycérine, pas étonnant que faire un copier/coller de code ne marche pas.

 

Désolé, mais je doute que raisonner en voulant tirer vers le bas ceux qui cherchent à t'aider soit une bonne solution. A part faire grimper l'aigritude des deux cotés, y'aura rien d'autre.

 

Si malgré tout ton objectif est de faire vite et fonctionnel, fait à la brute en progressive enhancement: commence avec ta page avec uniquement le captcha dessus, et insère ton code petit à petit jusqu'a voir qu'il insert coince. Compte pas sur nous pour faire ca en tout cas.


Message édité par Gf4x3443 le 27-07-2008 à 14:24:13
mood
Publicité
Posté le 27-07-2008 à 14:23:12  profilanswer
 

n°1765459
zepouss
Posté le 27-07-2008 à 16:57:32  profilanswer
 

Merci, vous avez entièrement raison.
 
Je vais essayer de voir les erreurs. Si j'ai un souci sur une ligne en particulier je demanderai conseil mais je pense que pour le moment on peut fermer le post.
 
A bientôt et bonne continuation. Merci encore.


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Livre d'or - Recherche d'un anti spam efficace

 

Sujets relatifs
Recherche dans un fichier binaireRecherche un développeur web ASP
batch de recherche / suppressionRecherche/suppression fichier batch
[VB6] Question, "Le grand livre visual basic 6"[RESOLU] Recherche de Flux RSS
[Resolu] asp.net/C#/SQl server2005 affichage resultats recherchecondition where : recherche par mot clé
Nouveau livre de Symbian Press[SQL server] Recherche sur champ calculé
Plus de sujets relatifs à : Livre d'or - Recherche d'un anti spam efficace


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR