Dreamweaver , formail...

Bonjour,
voici je gere mon site internet sans aucune formation , precisons le , depuis 4 ans www.raidsahara.com

je voudrais mettre des cages de texte du style , nom prenom , cliquez sur envoyez et je devrais recevoir
un email de la personne ...
j'ai un fichier de type formail , attaché à ma page HTML et depuis peu , il me renvoie vers une erreur en ligne 23 ...

comment faire ou comment reparer cette fonction ?
comme j'ai refait toutes les pages .... ou alors comment faire sur dreamweaver ?
Cordialement
Cyril

<?php
$dest="organisation@raidsahara.com";
$referer= getenv("HTTP_REFERER");
$ok=1;
if($ok){
$sujet= "Contact local départemental:";
$body.="Page d'origine : $referer\n";
$body.="\n*** Valeurs resultats ***\n";

if(count($HTTP_POST_VARS)){
while (list($key, $val) = each($HTTP_POST_VARS)){
$body.="$key : $val\n";
}
}

if(count($HTTP_GET_VARS)){
while (list($key, $val) = each($HTTP_GET_VARS)){
$body.="$key : $val\n";
}
}

$body.="*************************\n";
if(!email("contact",$dest,$sujet,$body)){
print "erreur envoi email <br>";
}

// affiche le html qui suit si succes
?>
<html>
<head><title>RaidSahara</title></head>
<meta http-equiv="refresh" content="0;URL=http://www.raidsahara.com/index.htm">
<body bgcolor="white">
</body>
</html>
<?php
}
// affiche le html qui suit si erreur
?>
<html>
<head><title>Erreur de saisie</title></head>
<meta http-equiv="refresh" content="0;URL=http://www.raidsahara.com/index.htm">
<body bgcolor="white">
</body>
</html>
<?php
?>
Configuration: Windows XP
Internet Explorer 7.0

5 réponses

  1. merci .....
    ya un petit mieux , ça ne bloque pas ,
    et ça repart sur la page d'accueil ,normal , mais pas de mail ......
    1. essaie ça, et verifie sinon que tu as bien configuré les mail dans php.ini ...

      if(!email("contact",$dest,$sujet,$body)){
      echo "erreur envoi email <br><a href=\"http://www.raidsahara.com/index.htm\">Retour</a>";
      }
      else {
      echo "
      <html>
      <head><title>RaidSahara</title></head>
      <meta http-equiv=\"refresh\" content=\"3;URL=http://www.raidsahara.com/index.htm\">
      <body bgcolor=\"white\">Message envoyé
      </body>
      </html>";
      }
      ?> 
      1. j'efface tout le reste , ou alors je complete ou substitue ?
        1. <?php
          $dest="organisation@raidsahara.com";
          $referer= getenv("HTTP_REFERER");
          $ok=1;
          if($ok){
          $sujet= "Contact local départemental:";
          $body.="Page d'origine : $referer\n";
          $body.="\n*** Valeurs resultats ***\n";
          
          if(count($HTTP_POST_VARS)){
          while (list($key, $val) = each($HTTP_POST_VARS)){
          $body.="$key : $val\n";
          }
          }
          
          if(count($HTTP_GET_VARS)){
          while (list($key, $val) = each($HTTP_GET_VARS)){
          $body.="$key : $val\n";
          }
          }
          
          $body.="*************************\n";
          if(!email("contact",$dest,$sujet,$body)){
          echo "erreur envoi email <br><a href=\"http://www.raidsahara.com/index.htm\">Retour</a>";
          }
          else {
          echo "
          <meta http-equiv=\"refresh\" content=\"3;URL=http://www.raidsahara.com/index.htm\">
          Message envoyé";
          }
          ?>


          S'il y a une erreur il y a probleme sinon faut revoir la configuration de php sinon...je ne sais point.