Index du Forum » » SFORM

Auteur

Pb avec le contrôle du formulaire
Stiven
30    

  Posté : 26-05-2004 17:30

Bonjour,

Désolé pour le retard.

Voici le contenu de mon fichier caeform.php, le contenu de mon formulaire cae.php :

<?PHP
/************************************************************************/ br />/* SFORM Extender for NPDS V Contact Example */
/* =========================== */
/* */
/* 2002 - 2003 */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/ br />
/*Boutons radio Titre (Mme, Mlle, M.)*/
$tit=array(
"s1"=>array('en'=>"Mme", 'checked'=>true),
"s2"=>array('en'=>"Mlle", 'checked'=>false),
"s3"=>array('en'=>"M.", 'checked'=>false)
);

/*Boutons radio Handicapés (Oui, non)*/
$handi=array(
"oui"=>array('en'=>"Oui", 'checked'=>false),
"non"=>array('en'=>"Non", 'checked'=>true)
);

/*Boutons radio allergies (Oui, non)*/
$allerg=array(
"s1"=>array('en'=>"Oui", 'checked'=>false),
"s2"=>array('en'=>"Non", 'checked'=>true)
);

/*Boutons radio regime (Oui, non)*/
$regime=array(
"s1"=>array('en'=>"Oui", 'checked'=>false),
"s2"=>array('en'=>"Non", 'checked'=>true)
);

$m->add_form_field_size(50);
$m->add_title("INSCRIPTION D'UNE COOPERATIVE D'ACTIVITE ET D'EMPLOI");
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_extra("<tr><td colspan=2><center><b>Votre coopérative</b></center></td></tr>");
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_field('nom', "Nom","",'text',true,150,"","");
$m->add_field('ad1', "Adresse","",'text',true,150,"",""); br />$m->add_field('ad2', "Complément d'adresse","",'text',true,150,"","");
$m->add_field('cpt', "Code Postal","",'text',true,5,"","0-9");
$m->add_field('ville', "Ville","",'text',true,150,"","");
$m->add_field('pays', "Pays","",'text',true,50,"","");
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_field('tel', "Tel","",'text',true,25,"","0-9extend") ;
$m->add_field('fax', "Fax","",'text',false,25,"","0-9extend" );
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_extra("<tr><td colspan=2><center><b>La personne référente</b></center></td></tr>");
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_radio('titre', "Titre", $tit, false);
$m->add_field('nom', "Nom","",'text',true,150,"","");
$m->add_field('prenom', "Prénom","",'text',true,150,"","");
$m->add_field('tel2', "Tel","",'text',true,25,"","0-9extend") ;
$m->add_field('mob', "Mobile","",'text',false,25,"","0-9extend&qu ot;);
$m->add_field('email', "Adresse de messagerie","",'text',false,255,"","email");
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_extra("<tr><td colspan=2><center><b>Les participants</b></center></td></tr>");
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_field('entrepreneurs', "Nb d'entrepreneurs","",'text',true,2,"","0-9");
$m->add_field('encadrants', "Nb d'encadrants","",'text',true,2,"","0-9"); br /> $m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_extra("<tr><td colspan=2><center><b>Quelques informations utiles</b></center></td></tr>");
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_extra("<tr><td align=\"right\"><b>Personnes handicapées</b></td><td> </td></tr>");
$m->add_radio('handi', "Y'a-t-il des personnes en fauteuil roulant parmi les participants ?", $handi, false);
$m->add_field('nbhandi', "Si oui, combien ?","",'text',false,2,"","0-9");
$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_extra("<tr><td align=\"right\"><b>Allergies, régime alimentaire</b></td><td> </td></tr>");
$m->add_radio('allerg', "Y'a-t-il des personnes souffrant d'une allergie ?", $allerg, false);
$m->add_field('allergtext', "Si oui, précisez","",'textarea',false,200,4,"0-9");
$m->add_radio('regime', "Y'a-t-il des personnes suivant un régime alimentaire particulier ?<br>(végétarien, médical, tradition religieuse, etc.)", $regime, false);
$m->add_field('regimetext', "Si oui, précisez","",'textarea',false,200,4,"0-9");

$m->add_extra("<tr><td colspan=2> </td></tr>");
$m->add_comment("<center><b><u>ATTENTION</u>& lt;/b><br>Ce formulaire est une demande d'inscription.<br>Cette demande sera traitée par \"Coopérer pour entreprendre\"<br>et la validation de votre inscription vous sera notifiée par courrier électronique ou écrit.</center>");
$m->add_extra("<tr><td colspan=2> </td></tr>");
// ----------------------------------------------------------------
// CES CHAMPS sont indispensables --- Don't remove these fields
$m->add_extra("<tr><td align=center colspan=2>");
// Reset bouton
$m->add_field("","","Remise à zéro",'reset',false);
// Return bouton
$m->add_extra(" ");
$m->add_extra("<a href=index.php>[ Annuler ]</a>");
// Submit bouton
$m->add_extra(" ");
$m->add_field("","","Valider",'submit',false );
$m->add_extra("</td></tr>");
// ----------------------------------------------------------------
?>

Pour info, voici le contenu de mon fichier cae.php :

<?
/************************************************************************/ br />/* SFORM Extender for NPDS V Contact Example */
/* =========================== */
/* */
/* 2002 - 2003 */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/ br />/* Dont modify this file is you dont know what you make */
/************************************************************************/ br />
global $ModPath, $ModStart;
$sform_path="modules/sform/";
!include!_once($sform_path."sform.php");

global $m;
$m=new form_handler();
//********************
$m->add_form_title("INSCRIPTION COOPERATIVE D'ACTIVITE ET D'EMPLOI");
$m->add_form_method("post");
$m->add_form_check("true");
$m->add_mess(" <font class=\"ROUGE\">*</font> désigne un champ obligatoire ");
$m->add_submit_value("ok");
$m->add_!url(!"modules.php");
$m->add_field("ModStart","",$ModStart,'hidden',false);
$m->add_field("ModPath","",$ModPath,'hidden',false); br />
/************************************************/
!include!($sform_path."contact/caeform.php");
/************************************************/
// Manage the <form>
switch($ok) {

case 'Valider':
$m->make_response();
$message=$m->aff_response("#006EB9","not_echo","&qu ot;);
// global $notify_email;
$message="<html><body>".$message."</body></ html>";
send_email("monadresse@mondomaine.org", $m->title,$message,"","","html");
opentable();
echo "<center>Votre demande est prise en compte. Nous y répondrons au plus vite</center>";
closetable();
break;

default:
echo $m->print_form("#006EB9");
break;
}
?>

Voilà,

Merci (beaucoup) d'avance pour ton aide.

@+



Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=11582&forum=19