Probleme formulaire script CGI

Babriel Messages postés 2 Date d'inscription   Statut Membre Dernière intervention   -  
Babriel Messages postés 2 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

Voila mon but:
Creer un formulaire permetant au visiteur de mon site de m'envoyer un message avec
- Nom du personage
-Nom de compte
-Mot de passe

Je sais programmer le formulaire : http://dofbot.ifrance.com/formu.php

Mais je ne sais pas faire le script CGI
J'ai piquer le formulaire a ifrance.com mais la methode de poste ne marche pas.

Ligne qui me pose probleme:

("<form name='acontact' method='post' action='http://tools.ifrance.com/contact/contact_send_mail.php?log=dofbot&id=5351662' OnSubmit='return checkacontactform();'>")


Code:

<script>

function checkacontactform() {
var modele = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]{2,4}$/;
var err = "Error:\n";
var email = document.getElementById('resp_mail').value;
if (!modele.test(email))
err+=" - Email invalid\n";
if (document.getElementById('msg').value == '')
err+=" - No Content\n";
if (err == "Error:\n")
return true;
alert(err);
return false;
}

document.write("<style>.a12gris{font-family: Arial;font-size: 12px;color: #333333;}.champ1{background-color:#FFFFFF;border:1px solid #A8BDD8;font-family: Arial;font-size: 11px;color: #333333;}</style>");
document.write("<form name='acontact' method='post' action=<script>

function checkacontactform() {
var modele = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]{2,4}$/;
var err = "Error:\n";
var email = document.getElementById('resp_mail').value;
if (!modele.test(email))
err+=" - Email invalid\n";
if (document.getElementById('msg').value == '')
err+=" - No Content\n";
if (err == "Error:\n")
return true;
alert(err);
return false;
}

document.write("<style>.a12gris{font-family: Arial;font-size: 12px;color: #333333;}.champ1{background-color:#FFFFFF;border:1px solid #A8BDD8;font-family: Arial;font-size: 11px;color: #333333;}</style>");
document.write("<form name='acontact' method='post' action='JE NE SAIS PAS FAIRE' OnSubmit='return checkacontactform();'>");
document.write("<input type='hidden' value='' name='log'>");
document.write("<input type='hidden' value='"+document.location.href+"' name='return_url'>");
document.write("<table cellspacing='0' cellpadding='5' style='border:3px solid #CEE5F3;'>");
document.write("<tr>");
document.write("<td class='a12gris'>Votre adresse mail:</td>");
document.write("<td><input class='champ1' type='text' id='resp_mail' name='resp_mail' size='24' value=''></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td class='a12gris'>Nom de compte</td>");
document.write("<td><input class='champ1' type='text' size='24' id='title' name='title' value=''></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td class='a12gris'>Mot de passe</td>");
document.write("<td><input class='champ1' type='text' size='24' id='title' name='title' value=''></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td colspan='2' align='right'><input type='submit' value='Envoyer'></td>");
document.write("</tr>");
document.write("</table>");
document.write("</form>");

</script>

<script type="text/javascript" src="http://js-perso.ifrance.com/weborama.js"></script>
<script language="Javascript" type="text/javascript">
<!--
document.write('<sc'+'ript src="http://js-perso.ifrance.com/js2.php?'+rnd+'"><'+'/sc'+'ript>');
// -->
</script>
662' OnSubmit='return checkacontactform();'>");
document.write("<input type='hidden' value='' name='log'>");
document.write("<input type='hidden' value='"+document.location.href+"' name='return_url'>");
document.write("<table cellspacing='0' cellpadding='5' style='border:3px solid #CEE5F3;'>");
document.write("<tr>");
document.write("<td class='a12gris'>Votre adresse mail:</td>");
document.write("<td><input class='champ1' type='text' id='resp_mail' name='resp_mail' size='24' value=''></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td class='a12gris'>Nom de compte</td>");
document.write("<td><input class='champ1' type='text' size='24' id='title' name='title' value=''></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td class='a12gris'>Mot de passe</td>");
document.write("<td><input class='champ1' type='text' size='24' id='title' name='title' value=''></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td colspan='2' align='right'><input type='submit' value='Envoyer'></td>");
document.write("</tr>");
document.write("</table>");
document.write("</form>");

</script>

Voili j'espere que vous pourrai m'aider a programmer le script =)
Merci d'avance
A voir également:

1 réponse

Babriel Messages postés 2 Date d'inscription   Statut Membre Dernière intervention   2
 
Oups désole >< j'ai trouvé la solution tout seul ...

J'ai tout simplement eut recours à un générateur automatique de formulaire.
Et mon hébergeur ne toléré pas les formulaire ...
2