par
DOFUS » 13 juil. 2007, 12:05
Bonjour, je sais, trés bien que le code que je vais vous présenter est bien long at qu'il y a moyen de faire beaucoup plus court, mais bon sa ma flaisir d'étudier tout les cas possibles lignes par lignes... Ma question est "Y a t-il des erreur d'inatention ou autres ?", merci.
Normalement je peut le vérifier mais j'ai un petit problème avec mon esayphp...
<?php
include('inc/inc_start.php');
//--->> RECEPTION
$sd01 = $_POST['civilite'];
$sd02 = $_POST['nom'];
$sd03 = $_POST['prenom'];
$sd04 = $_POST['idserveur'];
$sd05 = $_POST['date_de_naissance_jour'];
$sd06 = $_POST['date_de_naissance_mois'];
$sd07 = $_POST['date_de_naissance_annee'];
$sd08 = $_POST['sexe'];
$sd09 = $_POST['numero_de_rue'];
$sd10 = $_POST['rue'];
$sd11 = $_POST['code_postal'];
$sd12 = $_POST['batiment'];
$sd13 = $_POST['etage'];
$sd14 = $_POST['porte'];
$sd15 = $_POST['ville'];
$sd16 = $_POST['pays'];
$sd17 = $_POST['numero_de_telephone_fixe'];
$sd18 = $_POST['numero_de_telephone_portable'];
$sd19 = $_POST['email'];
$sd20 = $_POST['mot_de_passe'];
$sd21 = $_POST['confirmation_mot_de_passe'];
$sd22 = $_POST['charte'];
$erreur = "0";
//--->> CORRECTION
if($sd22 != "ON") {$_SESSION['Error_Y0001'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
//...
if($sd17 == $sd18) {$_SESSION['Error_Y0006'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
$sd04 = str_replace(" ","_",$sd04);
if(sd01 == ""){$_SESSION['Error_Z0001'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
//...etc...
if(sd04 == ""){$_SESSION['Error_Z0009'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
// <<----->> NOM <<----->> DEBUT <<----->>
$spAC001 = strpos($sd02,"&");
$spAC002 = strpos($sd02,"²");
$spAC003 = strpos($sd02,"#");
$spAC004 = strpos($sd02,"\"");
$spAC005 = strpos($sd02,"{");
$spAC006 = strpos($sd02,"[");
$spAC007 = strpos($sd02,"(");
$spAC008 = strpos($sd02,"|");
$spAC009 = strpos($sd02,"\\");
$spAC010 = strpos($sd02,"`");
$spAC011 = strpos($sd02,"@");
$spAC012 = strpos($sd02,"]");
$spAC013 = strpos($sd02,"_");
$spAC014 = strpos($sd02,")");
$spAC015 = strpos($sd02,"}");
$spAC016 = strpos($sd02,"=");
$spAC017 = strpos($sd02,"+");
$spAC018 = strpos($sd02,"¤");
$spAC019 = strpos($sd02,"$");
$spAC020 = strpos($sd02,"£");
$spAC021 = strpos($sd02,"%");
$spAC022 = strpos($sd02,"*");
$spAC023 = strpos($sd02,"µ");
$spAC024 = strpos($sd02,"§");
$spAC025 = strpos($sd02,"!");
$spAC026 = strpos($sd02,":");
$spAC027 = strpos($sd02,".");
$spAC028 = strpos($sd02,";");
$spAC029 = strpos($sd02,",");
$spAC030 = strpos($sd02,"?");
$spAC031 = strpos($sd02,">");
$spAC032 = strpos($sd02,"<");
$spAC033 = strpos($sd02,"0");
$spAC034 = strpos($sd02,"1");
$spAC035 = strpos($sd02,"2");
$spAC036 = strpos($sd02,"3");
$spAC037 = strpos($sd02,"4");
$spAC038 = strpos($sd02,"5");
$spAC039 = strpos($sd02,"6");
$spAC040 = strpos($sd02,"7");
$spAC041 = strpos($sd02,"8");
$spAC042 = strpos($sd02,"9");
if($spAC001 != '') {$_SESSION['Error_A0001'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
//... etc
if($spAC042 != '') {$_SESSION['Error_A0042'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
$stAB1 = st10rtolower($sd02);
$stAB2 = subst10r("$stAB1", 0, 1);
if($stAB2 == "a" OR $stAB2 == "b" OR $stAB2 == "c" OR $stAB2 == "d" OR $stAB2 == "e" OR $stAB2 == "f" OR $stAB2 == "g" OR $stAB2 == "h" OR $stAB2 == "i" OR $stAB2 == "j" OR $stAB2 == "k" OR $stAB2 == "l" OR $stAB2 == "m" OR $stAB2 == "n" OR $stAB2 == "o" OR $stAB2 == "p" OR $stAB2 == "q" OR $stAB2 == "r" OR $stAB2 == "s" OR $stAB2 == "t" OR $stAB2 == "u" OR $stAB2 == "v" OR $stAB2 == "w" OR $stAB2 == "x" OR $stAB2 == "y"OR $stAB2 == "z"){$_SESSION['Error_A0043'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
if($stAB2 != "a" OR $stAB2 != "b" OR $stAB2 != "c" OR $stAB2 != "d" OR $stAB2 != "e" OR $stAB2 != "f" OR $stAB2 != "g" OR $stAB2 != "h" OR $stAB2 != "i" OR $stAB2 != "j" OR $stAB2 != "k" OR $stAB2 != "l" OR $stAB2 != "m" OR $stAB2 != "n" OR $stAB2 != "o" OR $stAB2 != "p" OR $stAB2 != "q" OR $stAB2 != "r" OR $stAB2 != "s" OR $stAB2 != "t" OR $stAB2 != "u" OR $stAB2 != "v" OR $stAB2 != "w" OR $stAB2 != "x" OR $stAB2 != "y"OR $stAB2 != "z"){$_SESSION['Error_A0044'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
// <<----->> NOM <<----->> FIN <<----->>
// <<----->> PRENOM <<----->> DEBUT <<----->>
$spBC001 = strpos($sd03,"&");
$spBC042 = strpos($sd03,"9");
if($spBC001 != '') {$_SESSION['Error_B0001'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
//etc...
if($spBC042 != '') {$_SESSION['Error_B0042'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
$stBB1 = st10rtolower($sd03);
$stBB2 = subst10r("$stBB1", 0, 1);
if($stBB2 == "a" OR $stBB2 == "b" OR $stBB2 == "c" OR $stBB2 == "d" OR $stBB2 == "e" OR $stBB2 == "f" OR $stBB2 == "g" OR $stBB2 == "h" OR $stBB2 == "i" OR $stBB2 == "j" OR $stBB2 == "k" OR $stBB2 == "l" OR $stBB2 == "m" OR $stBB2 == "n" OR $stBB2 == "o" OR $stBB2 == "p" OR $stBB2 == "q" OR $stBB2 == "r" OR $stBB2 == "s" OR $stBB2 == "t" OR $stBB2 == "u" OR $stBB2 == "v" OR $stBB2 == "w" OR $stBB2 == "x" OR $stBB2 == "y"OR $stBB2 == "z"){$_SESSION['Error_B0043'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
if($stBB2 != "a" OR $stBB2 != "b" OR $stBB2 != "c" OR $stBB2 != "d" OR $stBB2 != "e" OR $stBB2 != "f" OR $stBB2 != "g" OR $stBB2 != "h" OR $stBB2 != "i" OR $stBB2 != "j" OR $stBB2 != "k" OR $stBB2 != "l" OR $stBB2 != "m" OR $stBB2 != "n" OR $stBB2 != "o" OR $stBB2 != "p" OR $stBB2 != "q" OR $stBB2 != "r" OR $stBB2 != "s" OR $stBB2 != "t" OR $stBB2 != "u" OR $stBB2 != "v" OR $stBB2 != "w" OR $stBB2 != "x" OR $stBB2 != "y"OR $stBB2 != "z"){$_SESSION['Error_B0044'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
// <<----->> PRENOM <<----->> FIN <<----->>
// <<----->> VILLE <<----->> DEBUT <<----->>
$spCC001 = strpos($sd15,"&");
$spCC002 = strpos($sd15,"²");
$spCC003 = strpos($sd15,"#");
$spCC004 = strpos($sd15,"\"");
$spCC005 = strpos($sd15,"{");
$spCC006 = strpos($sd15,"[");
$spCC007 = strpos($sd15,"(");
$spCC008 = strpos($sd15,"|");
$spCC009 = strpos($sd15,"\\");
$spCC010 = strpos($sd15,"`");
$spCC011 = strpos($sd15,"@");
$spCC012 = strpos($sd15,"]");
$spCC013 = strpos($sd15,"_");
$spCC014 = strpos($sd15,")");
$spCC015 = strpos($sd15,"}");
$spCC016 = strpos($sd15,"=");
$spCC017 = strpos($sd15,"+");
$spCC018 = strpos($sd15,"¤");
$spCC019 = strpos($sd15,"$");
$spCC020 = strpos($sd15,"£");
$spCC021 = strpos($sd15,"%");
$spCC022 = strpos($sd15,"*");
$spCC023 = strpos($sd15,"µ");
$spCC024 = strpos($sd15,"§");
$spCC025 = strpos($sd15,"!");
$spCC026 = strpos($sd15,":");
$spCC027 = strpos($sd15,".");
$spCC028 = strpos($sd15,";");
$spCC029 = strpos($sd15,",");
$spCC030 = strpos($sd15,"?");
$spCC031 = strpos($sd15,">");
$spCC032 = strpos($sd15,"<");
$spCC033 = strpos($sd15,"0");
$spCC034 = strpos($sd15,"1");
$spCC035 = strpos($sd15,"2");
$spCC036 = strpos($sd15,"3");
$spCC037 = strpos($sd15,"4");
$spCC038 = strpos($sd15,"5");
$spCC039 = strpos($sd15,"6");
$spCC040 = strpos($sd15,"7");
$spCC041 = strpos($sd15,"8");
$spCC042 = strpos($sd15,"9");
Bonjour, je sais, trés bien que le code que je vais vous présenter est bien long at qu'il y a moyen de faire beaucoup plus court, mais bon sa ma flaisir d'étudier tout les cas possibles lignes par lignes... Ma question est "Y a t-il des erreur d'inatention ou autres ?", merci.
Normalement je peut le vérifier mais j'ai un petit problème avec mon esayphp...
[php]
<?php
include('inc/inc_start.php');
//--->> RECEPTION
$sd01 = $_POST['civilite'];
$sd02 = $_POST['nom'];
$sd03 = $_POST['prenom'];
$sd04 = $_POST['idserveur'];
$sd05 = $_POST['date_de_naissance_jour'];
$sd06 = $_POST['date_de_naissance_mois'];
$sd07 = $_POST['date_de_naissance_annee'];
$sd08 = $_POST['sexe'];
$sd09 = $_POST['numero_de_rue'];
$sd10 = $_POST['rue'];
$sd11 = $_POST['code_postal'];
$sd12 = $_POST['batiment'];
$sd13 = $_POST['etage'];
$sd14 = $_POST['porte'];
$sd15 = $_POST['ville'];
$sd16 = $_POST['pays'];
$sd17 = $_POST['numero_de_telephone_fixe'];
$sd18 = $_POST['numero_de_telephone_portable'];
$sd19 = $_POST['email'];
$sd20 = $_POST['mot_de_passe'];
$sd21 = $_POST['confirmation_mot_de_passe'];
$sd22 = $_POST['charte'];
$erreur = "0";
//--->> CORRECTION
if($sd22 != "ON") {$_SESSION['Error_Y0001'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
//...
if($sd17 == $sd18) {$_SESSION['Error_Y0006'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
$sd04 = str_replace(" ","_",$sd04);
if(sd01 == ""){$_SESSION['Error_Z0001'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
//...etc...
if(sd04 == ""){$_SESSION['Error_Z0009'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
// <<----->> NOM <<----->> DEBUT <<----->>
$spAC001 = strpos($sd02,"&");
$spAC002 = strpos($sd02,"²");
$spAC003 = strpos($sd02,"#");
$spAC004 = strpos($sd02,"\"");
$spAC005 = strpos($sd02,"{");
$spAC006 = strpos($sd02,"[");
$spAC007 = strpos($sd02,"(");
$spAC008 = strpos($sd02,"|");
$spAC009 = strpos($sd02,"\\");
$spAC010 = strpos($sd02,"`");
$spAC011 = strpos($sd02,"@");
$spAC012 = strpos($sd02,"]");
$spAC013 = strpos($sd02,"_");
$spAC014 = strpos($sd02,")");
$spAC015 = strpos($sd02,"}");
$spAC016 = strpos($sd02,"=");
$spAC017 = strpos($sd02,"+");
$spAC018 = strpos($sd02,"¤");
$spAC019 = strpos($sd02,"$");
$spAC020 = strpos($sd02,"£");
$spAC021 = strpos($sd02,"%");
$spAC022 = strpos($sd02,"*");
$spAC023 = strpos($sd02,"µ");
$spAC024 = strpos($sd02,"§");
$spAC025 = strpos($sd02,"!");
$spAC026 = strpos($sd02,":");
$spAC027 = strpos($sd02,".");
$spAC028 = strpos($sd02,";");
$spAC029 = strpos($sd02,",");
$spAC030 = strpos($sd02,"?");
$spAC031 = strpos($sd02,">");
$spAC032 = strpos($sd02,"<");
$spAC033 = strpos($sd02,"0");
$spAC034 = strpos($sd02,"1");
$spAC035 = strpos($sd02,"2");
$spAC036 = strpos($sd02,"3");
$spAC037 = strpos($sd02,"4");
$spAC038 = strpos($sd02,"5");
$spAC039 = strpos($sd02,"6");
$spAC040 = strpos($sd02,"7");
$spAC041 = strpos($sd02,"8");
$spAC042 = strpos($sd02,"9");
if($spAC001 != '') {$_SESSION['Error_A0001'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
//... etc
if($spAC042 != '') {$_SESSION['Error_A0042'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
$stAB1 = st10rtolower($sd02);
$stAB2 = subst10r("$stAB1", 0, 1);
if($stAB2 == "a" OR $stAB2 == "b" OR $stAB2 == "c" OR $stAB2 == "d" OR $stAB2 == "e" OR $stAB2 == "f" OR $stAB2 == "g" OR $stAB2 == "h" OR $stAB2 == "i" OR $stAB2 == "j" OR $stAB2 == "k" OR $stAB2 == "l" OR $stAB2 == "m" OR $stAB2 == "n" OR $stAB2 == "o" OR $stAB2 == "p" OR $stAB2 == "q" OR $stAB2 == "r" OR $stAB2 == "s" OR $stAB2 == "t" OR $stAB2 == "u" OR $stAB2 == "v" OR $stAB2 == "w" OR $stAB2 == "x" OR $stAB2 == "y"OR $stAB2 == "z"){$_SESSION['Error_A0043'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
if($stAB2 != "a" OR $stAB2 != "b" OR $stAB2 != "c" OR $stAB2 != "d" OR $stAB2 != "e" OR $stAB2 != "f" OR $stAB2 != "g" OR $stAB2 != "h" OR $stAB2 != "i" OR $stAB2 != "j" OR $stAB2 != "k" OR $stAB2 != "l" OR $stAB2 != "m" OR $stAB2 != "n" OR $stAB2 != "o" OR $stAB2 != "p" OR $stAB2 != "q" OR $stAB2 != "r" OR $stAB2 != "s" OR $stAB2 != "t" OR $stAB2 != "u" OR $stAB2 != "v" OR $stAB2 != "w" OR $stAB2 != "x" OR $stAB2 != "y"OR $stAB2 != "z"){$_SESSION['Error_A0044'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
// <<----->> NOM <<----->> FIN <<----->>
// <<----->> PRENOM <<----->> DEBUT <<----->>
$spBC001 = strpos($sd03,"&");
$spBC042 = strpos($sd03,"9");
if($spBC001 != '') {$_SESSION['Error_B0001'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
//etc...
if($spBC042 != '') {$_SESSION['Error_B0042'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
$stBB1 = st10rtolower($sd03);
$stBB2 = subst10r("$stBB1", 0, 1);
if($stBB2 == "a" OR $stBB2 == "b" OR $stBB2 == "c" OR $stBB2 == "d" OR $stBB2 == "e" OR $stBB2 == "f" OR $stBB2 == "g" OR $stBB2 == "h" OR $stBB2 == "i" OR $stBB2 == "j" OR $stBB2 == "k" OR $stBB2 == "l" OR $stBB2 == "m" OR $stBB2 == "n" OR $stBB2 == "o" OR $stBB2 == "p" OR $stBB2 == "q" OR $stBB2 == "r" OR $stBB2 == "s" OR $stBB2 == "t" OR $stBB2 == "u" OR $stBB2 == "v" OR $stBB2 == "w" OR $stBB2 == "x" OR $stBB2 == "y"OR $stBB2 == "z"){$_SESSION['Error_B0043'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
if($stBB2 != "a" OR $stBB2 != "b" OR $stBB2 != "c" OR $stBB2 != "d" OR $stBB2 != "e" OR $stBB2 != "f" OR $stBB2 != "g" OR $stBB2 != "h" OR $stBB2 != "i" OR $stBB2 != "j" OR $stBB2 != "k" OR $stBB2 != "l" OR $stBB2 != "m" OR $stBB2 != "n" OR $stBB2 != "o" OR $stBB2 != "p" OR $stBB2 != "q" OR $stBB2 != "r" OR $stBB2 != "s" OR $stBB2 != "t" OR $stBB2 != "u" OR $stBB2 != "v" OR $stBB2 != "w" OR $stBB2 != "x" OR $stBB2 != "y"OR $stBB2 != "z"){$_SESSION['Error_B0044'] = "NEGADORUS"; $erreur = $erreur + 1 ;}
// <<----->> PRENOM <<----->> FIN <<----->>
// <<----->> VILLE <<----->> DEBUT <<----->>
$spCC001 = strpos($sd15,"&");
$spCC002 = strpos($sd15,"²");
$spCC003 = strpos($sd15,"#");
$spCC004 = strpos($sd15,"\"");
$spCC005 = strpos($sd15,"{");
$spCC006 = strpos($sd15,"[");
$spCC007 = strpos($sd15,"(");
$spCC008 = strpos($sd15,"|");
$spCC009 = strpos($sd15,"\\");
$spCC010 = strpos($sd15,"`");
$spCC011 = strpos($sd15,"@");
$spCC012 = strpos($sd15,"]");
$spCC013 = strpos($sd15,"_");
$spCC014 = strpos($sd15,")");
$spCC015 = strpos($sd15,"}");
$spCC016 = strpos($sd15,"=");
$spCC017 = strpos($sd15,"+");
$spCC018 = strpos($sd15,"¤");
$spCC019 = strpos($sd15,"$");
$spCC020 = strpos($sd15,"£");
$spCC021 = strpos($sd15,"%");
$spCC022 = strpos($sd15,"*");
$spCC023 = strpos($sd15,"µ");
$spCC024 = strpos($sd15,"§");
$spCC025 = strpos($sd15,"!");
$spCC026 = strpos($sd15,":");
$spCC027 = strpos($sd15,".");
$spCC028 = strpos($sd15,";");
$spCC029 = strpos($sd15,",");
$spCC030 = strpos($sd15,"?");
$spCC031 = strpos($sd15,">");
$spCC032 = strpos($sd15,"<");
$spCC033 = strpos($sd15,"0");
$spCC034 = strpos($sd15,"1");
$spCC035 = strpos($sd15,"2");
$spCC036 = strpos($sd15,"3");
$spCC037 = strpos($sd15,"4");
$spCC038 = strpos($sd15,"5");
$spCC039 = strpos($sd15,"6");
$spCC040 = strpos($sd15,"7");
$spCC041 = strpos($sd15,"8");
$spCC042 = strpos($sd15,"9");
[/php]