1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Balcicars Bütgenbach</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="Design" href="design-traitement-annonces.css" />
</head>
<body>
<p>
<?php
$i = 0;
$poid_max_avatar = 2000000;
$largeur_max_avatar = 100000000000000000;
$longeur_max_avatar = 100000000000000000;
//On définit les variables :
$maxsize = $poid_max_avatar; //Poid de l'image
$maxwidth = $largeur_max_avatar; //Largeur de l'image
$maxheight = $longeur_max_avatar; //Longueur de l'image
$extensions_valides = array( 'jpg' , 'jpeg' , 'gif' , 'png', 'bmp' ); //Liste des extensions valides
if ($_FILES['photo1']['error'] > 0)
{
$i++;
}
if ($_FILES['photo1']['size'] > $maxsize)
{
$i++;
}
$image_sizes = getimagesize($_FILES['photo1']['tmp_name']);
if ($image_sizes[0] > $maxwidth OR $image_sizes[1] > $maxheight)
{
$i++;
}
$extension_upload = strtolower(substr( strrchr($_FILES['photo1']['name'], '.') ,1));
if (!in_array($extension_upload,$extensions_valides) )
{
$i++;
}
if ($i == 0)
{
//On déplace l'avatar
$avatar = time();
$nomavatar = str_replace(' ','',$avatar).".".$extension_upload;
$avatar = "./upload/".str_replace(' ','',$avatar).".".$extension_upload;
move_uploaded_file($_FILES['photo1']['tmp_name'],$avatar);
}
$nom = htmlspecialchars($_POST['nom']);
$prenom = htmlspecialchars($_POST['prenom']);
$ville = htmlspecialchars($_POST['ville']);
$mail = htmlspecialchars($_POST['mail']);
$telephone = htmlspecialchars($_POST['telephone']);
$gsm = htmlspecialchars($_POST['gsm']);
$marque_voiture = htmlspecialchars($_POST['marque_voiture']);
$modele_voiture = htmlspecialchars($_POST['modele_voiture']);
$cylindree = htmlspecialchars($_POST['cylindree']);
$chevaux = htmlspecialchars($_POST['chevaux']);
$carburant = htmlspecialchars($_POST['carburant']);
$kilometrage = htmlspecialchars($_POST['kilometrage']);
$annee = htmlspecialchars($_POST['annee']);
$prix = htmlspecialchars($_POST['prix']);
$infos_sup = htmlspecialchars($_POST['infos_sup']);
$destinataire = "balcicarsweb@hotmail.com";
$sujet = "Annonce";
$message = 'Nom : '.$nom.' Prenom : '.$prenom.' Ville : '.$ville.' Mail : '.$mail.' Telephone : '.$telephone.' GSM : '.$gsm.'
Marque voiture : '.$marque_voiture.' Modele voiture : '.$modele_voiture.' Cylindree : '.$cylindree.' Puissance : '.$chevaux.'
Carburant : '.$carburant.' Kilometrage : '.$kilometrage.' Annee : '.$annee.' Prix souhaite : '.$prix.'
Informations supplementaires : '.$infos_sup.' Photo : http://www.balcicars.be/upload/'.$nomavatar.'';
$entete = 'MIME-Version: 1.0' . "\r\n";
$entete .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$entete .= 'From: Testeur <test@test.com>' . "\r\n";
mail($destinataire, $sujet, $message, $entetes);
echo "L'email a bien été envoyé. MERCI";
?>
</p>
</body>
</html> |
Partager