par
zaknaou. » 25 avr. 2007, 22:42
Voilà j'ai apporté quelques modifications dont trime :
<?php
include ('inc_ouverture.php');
//------------------------------RECEPTION DES CHAMPS DE FORMULAIRES------------------------------>>
$civilite isset($_POST['civilite']) ? trim($_POST['civilite']) : "";
$nom isset($_POST['nom']) ? trim($_POST['nom']) : "";
$prenom isset($_POST['prenom']) ? trim($_POST['prenom']) : "";
$iduser isset($_POST['iduser']) ? trim($_POST['iduser']) : "";
$jour isset($_POST['jour']) ? trim($_POST['jour']) : "";
$mois isset($_POST['mois']) ? trim($_POST['mois']) : "";
$annee isset($_POST['annee']) ? trim($_POST['annee']) : "";
$numrue isset($_POST['numrue']) ? trim($_POST['numrue']) : "";
$rue isset($_POST['rue']) ? trim($_POST['rue']) : "";
$postal isset($_POST['postal']) ? trim($_POST['postal']) : "";
$batiment isset($_POST['batiment']) ? trim($_POST['batiment']) : "";
$etage isset($_POST['etage']) ? trim($_POST['etage']) : "";
$porte isset($_POST['porte']) ? trim($_POST['porte']) : "";
$ville isset($_POST['ville']) ? trim($_POST['ville']) : "";
$pays isset($_POST['pays']) ? trim($_POST['pays']) : "";
$fixe isset($_POST['fixe']) ? trim($_POST['fixe']) : "";
$portable isset($_POST['portable']) ? trim($_POST['portable']) : "";
$email isset($_POST['email']) ? trim($_POST['email']) : "";
$mdp isset($_POST['mdp']) ? trim($_POST['mdp']) : "";
$confirmation isset($_POST['confirmation']) ? trim($_POST['confirmation']) : "";
$avatar isset($_POST['avatar']) ? trim($_POST['avatar']) : "";
$site isset($_POST['site']) ? trim($_POST['site']) : "";
//--------------------------FIN DE RECEPTION DES CHAMPS DE FORMULAIRES--------------------------->>
if(($civilite == "") || ($prenom == "") || ($iduser == "") || ($datedenaissancejour == "") || ($datedenaissancemois == "") || ($datedenaissanceannee == "") || ($codepostal == "") || ($ville == "") || ($pays == "") || ($telephonefixe == "") || ($email == "") || ($motdepasse == "") || ($confirmotdepasse == ""))
{
//---------------------------------VERIFICATION DES CHAMPS VIDE--------------------------------->>
if ($civilite == "") { $_SESSION['civilite'] = "Le champs [Civilité] est vide, veuillez le compléter"; }
if ($prenom == "") { $_SESSION['prenom'] = "Le champs [Prenom] est vide, veuillez le compléter"; }
if ($iduser == "") { $_SESSION['iduser'] = "Le champs [Identifiant] est vide, veuillez le compléter"; }
if ($email == "") { $_SESSION['email'] = "Le champs [E-mail] est vide, veuillez le compléter"; }
if ($iduser == "") { $_SESSION['iduser'] = "Le champs [Identifiant] est vide, veuillez le compléter"; }
if ($jour == "") { $_SESSION['jour'] = "Le champs [Jour de naissance] est vide, veuillez le compléter"; }
if ($mois == "") { $_SESSION['mois'] = "Le champs [Mois de naissance] est vide, veuillez le compléter"; }
if ($annee == "") { $_SESSION['annee'] = "Le champs [Année de naissance] est vide, veuillez le compléter"; }
if ($postal == "") { $_SESSION['postal'] = "Le champs [Code postal] est vide, veuillez le compléter"; }
if ($ville == "") { $_SESSION['ville'] = "Le champs [Ville] est vide, veuillez le compléter"; }
if ($pays == "") { $_SESSION['pays'] = "Le champs [Pays] est vide, veuillez le compléter"; }
if ($fixe == "") { $_SESSION['fixe'] = "Le champs [Numéro de téléphone fixe] est vide, veuillez le compléter"; }
if ($portable == "") { $_SESSION['portable'] = "Le champs [Numéro de téléphone portable] est vide, veuillez le compléter"; }
if ($mdp == "") { $_SESSION['mdp'] = "Le champs [Mot de passe] est vide, veuillez le compléter"; }
if ($confirmation == "") { $_SESSION['confirmation'] = "Le champs [Confirmation du mot de passe] est vide, veuillez le compléter"; }
//------------------------------FIN DE VERIFICATION DES CHAMPS VIDE------------------------------>>
//--------------------------------VERIFICATION SPECIAL DES CHAMPS-------------------------------->>
// CHAMPS EMAIL AVEC @
$aroba = strpos($email,"@"); if($aroba == ''){$_SESSION['arobase'] = "Le champs [E-mail] doit contenir un arobase, veuillez le corriger";}
// CHAMPS EMAIL AVEC .
$point = strpos($email,".");if($point == ''){$_SESSION['point'] = "Le champs [E-mail] doit contenir un point, veuillez le corriger"; }
// CHAMPS MDP = CONFIRMATION
if($mdp == $confirmation){}else{ $_SESSION['differance'] = "Le champs [Mot de passe] n'est pas égal au champs [Confirmation du mot de passe], veuillez le corriger";}
//-----------------------------FIN DE VERIFICATION SPECIAL DES CHAMPS----------------------------->>
header('location:error_inscrip.php');
}
else
{
mysql_query(" INSERT INTO user (iduser) VALUES ('$iduser') ") or (header('location:error_inscrip_user.php'));
mysql_query(" UPDATE user SET email = $email WHERE iduser = '$iduser'") or (header('location:error_inscrip_email.php'));
mysql_query(" UPDATE user SET portable = $portable WHERE iduser = '$iduser'") or (header('location:error_inscrip_portable.php'));
mysql_query(" UPDATE user SET civilite = $civilite nom = $nom prenom = $prenom jour = $jour mois = $mois annee = $annee numrue = $numrue rue = $rue postal = $postal batiment = $batiment etage = $etage ville = $ville pays = $pays fixe = $fixe mdp = $mdp confirmation = $confirmation avatar = $avatar site = $site WHERE iduser = '$iduser'");
//-----------------------------VERIFICATION DE L'AVATAR----------------------------->>
$fwde = $fw_POST['de'];
$fwa = $fw_POST['a'];
$fwmessage = $fw_POST['message'];
include ('inc_date_heure.php');
$fwdossier = 'upload/';
$fwavatar = basename($fw_FILES['avatar']['name']);
$fwtaille_maxi = 100000;
$fwtaille = filesize($fw_FILES['avatar']['tmp_name']);
$fwextensions = array('.png', '.gif', '.jpg', '.jpeg', '.bmp');
$fwextension = strrchr($fw_FILES['avatar']['name'], '.');
if(!in_array($fwextension, $fwextensions))
{
$fwerreur = '1';
}
if($fwtaille>$fwtaille_maxi)
{
$fwerreur = '1';
}
if(!isset($fwerreur))
{
$fwavatar = strtr($fwavatar,
'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ',
'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy');
$fwavatar = preg_replace('/([^.a-z0-9]+)/i', '-', $fwavatar);
if(move_uploaded_file($fw_FILES['avatar']['tmp_name'], $fwdossier . $fwavatar))
{
header('location:conf_avatar.php');
}
else
{
header('location:error_avatar.php');
}
}
else
{
if($fwerreur == "1")
{
header('location:error_avatar.php');
}
}
mysql_query(" UPDATE user SET avatar = '$avatar' WHERE iduser = '$iduser' ");
//------------------------FIN DE LA VERIFICATION DE L'AVATAR------------------------>>
}
include ('inc_deconnexion_mysl.php');
?>
Voilà j'ai apporté quelques modifications dont trime :
[php]
<?php
include ('inc_ouverture.php');
//------------------------------RECEPTION DES CHAMPS DE FORMULAIRES------------------------------>>
$civilite isset($_POST['civilite']) ? trim($_POST['civilite']) : "";
$nom isset($_POST['nom']) ? trim($_POST['nom']) : "";
$prenom isset($_POST['prenom']) ? trim($_POST['prenom']) : "";
$iduser isset($_POST['iduser']) ? trim($_POST['iduser']) : "";
$jour isset($_POST['jour']) ? trim($_POST['jour']) : "";
$mois isset($_POST['mois']) ? trim($_POST['mois']) : "";
$annee isset($_POST['annee']) ? trim($_POST['annee']) : "";
$numrue isset($_POST['numrue']) ? trim($_POST['numrue']) : "";
$rue isset($_POST['rue']) ? trim($_POST['rue']) : "";
$postal isset($_POST['postal']) ? trim($_POST['postal']) : "";
$batiment isset($_POST['batiment']) ? trim($_POST['batiment']) : "";
$etage isset($_POST['etage']) ? trim($_POST['etage']) : "";
$porte isset($_POST['porte']) ? trim($_POST['porte']) : "";
$ville isset($_POST['ville']) ? trim($_POST['ville']) : "";
$pays isset($_POST['pays']) ? trim($_POST['pays']) : "";
$fixe isset($_POST['fixe']) ? trim($_POST['fixe']) : "";
$portable isset($_POST['portable']) ? trim($_POST['portable']) : "";
$email isset($_POST['email']) ? trim($_POST['email']) : "";
$mdp isset($_POST['mdp']) ? trim($_POST['mdp']) : "";
$confirmation isset($_POST['confirmation']) ? trim($_POST['confirmation']) : "";
$avatar isset($_POST['avatar']) ? trim($_POST['avatar']) : "";
$site isset($_POST['site']) ? trim($_POST['site']) : "";
//--------------------------FIN DE RECEPTION DES CHAMPS DE FORMULAIRES--------------------------->>
if(($civilite == "") || ($prenom == "") || ($iduser == "") || ($datedenaissancejour == "") || ($datedenaissancemois == "") || ($datedenaissanceannee == "") || ($codepostal == "") || ($ville == "") || ($pays == "") || ($telephonefixe == "") || ($email == "") || ($motdepasse == "") || ($confirmotdepasse == ""))
{
//---------------------------------VERIFICATION DES CHAMPS VIDE--------------------------------->>
if ($civilite == "") { $_SESSION['civilite'] = "Le champs [Civilité] est vide, veuillez le compléter"; }
if ($prenom == "") { $_SESSION['prenom'] = "Le champs [Prenom] est vide, veuillez le compléter"; }
if ($iduser == "") { $_SESSION['iduser'] = "Le champs [Identifiant] est vide, veuillez le compléter"; }
if ($email == "") { $_SESSION['email'] = "Le champs [E-mail] est vide, veuillez le compléter"; }
if ($iduser == "") { $_SESSION['iduser'] = "Le champs [Identifiant] est vide, veuillez le compléter"; }
if ($jour == "") { $_SESSION['jour'] = "Le champs [Jour de naissance] est vide, veuillez le compléter"; }
if ($mois == "") { $_SESSION['mois'] = "Le champs [Mois de naissance] est vide, veuillez le compléter"; }
if ($annee == "") { $_SESSION['annee'] = "Le champs [Année de naissance] est vide, veuillez le compléter"; }
if ($postal == "") { $_SESSION['postal'] = "Le champs [Code postal] est vide, veuillez le compléter"; }
if ($ville == "") { $_SESSION['ville'] = "Le champs [Ville] est vide, veuillez le compléter"; }
if ($pays == "") { $_SESSION['pays'] = "Le champs [Pays] est vide, veuillez le compléter"; }
if ($fixe == "") { $_SESSION['fixe'] = "Le champs [Numéro de téléphone fixe] est vide, veuillez le compléter"; }
if ($portable == "") { $_SESSION['portable'] = "Le champs [Numéro de téléphone portable] est vide, veuillez le compléter"; }
if ($mdp == "") { $_SESSION['mdp'] = "Le champs [Mot de passe] est vide, veuillez le compléter"; }
if ($confirmation == "") { $_SESSION['confirmation'] = "Le champs [Confirmation du mot de passe] est vide, veuillez le compléter"; }
//------------------------------FIN DE VERIFICATION DES CHAMPS VIDE------------------------------>>
//--------------------------------VERIFICATION SPECIAL DES CHAMPS-------------------------------->>
// CHAMPS EMAIL AVEC @
$aroba = strpos($email,"@"); if($aroba == ''){$_SESSION['arobase'] = "Le champs [E-mail] doit contenir un arobase, veuillez le corriger";}
// CHAMPS EMAIL AVEC .
$point = strpos($email,".");if($point == ''){$_SESSION['point'] = "Le champs [E-mail] doit contenir un point, veuillez le corriger"; }
// CHAMPS MDP = CONFIRMATION
if($mdp == $confirmation){}else{ $_SESSION['differance'] = "Le champs [Mot de passe] n'est pas égal au champs [Confirmation du mot de passe], veuillez le corriger";}
//-----------------------------FIN DE VERIFICATION SPECIAL DES CHAMPS----------------------------->>
header('location:error_inscrip.php');
}
else
{
mysql_query(" INSERT INTO user (iduser) VALUES ('$iduser') ") or (header('location:error_inscrip_user.php'));
mysql_query(" UPDATE user SET email = $email WHERE iduser = '$iduser'") or (header('location:error_inscrip_email.php'));
mysql_query(" UPDATE user SET portable = $portable WHERE iduser = '$iduser'") or (header('location:error_inscrip_portable.php'));
mysql_query(" UPDATE user SET civilite = $civilite nom = $nom prenom = $prenom jour = $jour mois = $mois annee = $annee numrue = $numrue rue = $rue postal = $postal batiment = $batiment etage = $etage ville = $ville pays = $pays fixe = $fixe mdp = $mdp confirmation = $confirmation avatar = $avatar site = $site WHERE iduser = '$iduser'");
//-----------------------------VERIFICATION DE L'AVATAR----------------------------->>
$fwde = $fw_POST['de'];
$fwa = $fw_POST['a'];
$fwmessage = $fw_POST['message'];
include ('inc_date_heure.php');
$fwdossier = 'upload/';
$fwavatar = basename($fw_FILES['avatar']['name']);
$fwtaille_maxi = 100000;
$fwtaille = filesize($fw_FILES['avatar']['tmp_name']);
$fwextensions = array('.png', '.gif', '.jpg', '.jpeg', '.bmp');
$fwextension = strrchr($fw_FILES['avatar']['name'], '.');
if(!in_array($fwextension, $fwextensions))
{
$fwerreur = '1';
}
if($fwtaille>$fwtaille_maxi)
{
$fwerreur = '1';
}
if(!isset($fwerreur))
{
$fwavatar = strtr($fwavatar,
'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ',
'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy');
$fwavatar = preg_replace('/([^.a-z0-9]+)/i', '-', $fwavatar);
if(move_uploaded_file($fw_FILES['avatar']['tmp_name'], $fwdossier . $fwavatar))
{
header('location:conf_avatar.php');
}
else
{
header('location:error_avatar.php');
}
}
else
{
if($fwerreur == "1")
{
header('location:error_avatar.php');
}
}
mysql_query(" UPDATE user SET avatar = '$avatar' WHERE iduser = '$iduser' ");
//------------------------FIN DE LA VERIFICATION DE L'AVATAR------------------------>>
}
include ('inc_deconnexion_mysl.php');
?>
[/php]