hello all and all, I have an html page that I would like to redirect depending on the choice of select,Here is the html page
`
Provider ID
Name
Enter your Mail
and here is the php processing page
`<?php
session_start();//on démarre la session
// $errors = [];
$errors = array(); // on crée une vérif de champs
if(!array_key_exists(‘Name’, $_POST) || $_POST[‘Name’] == ‘’) {// on verifie l’existence du champ et d’un contenu
$errors [‘Name’] = “vous n’avez pas renseigné votre nom”;
}
if(!array_key_exists(‘mail’, $_POST) || $_POST[‘mail’] == ‘’ || !filter_var($_POST[‘mail’], FILTER_VALIDATE_EMAIL)) {// on verifie existence de la clé
$errors [‘mail’] = “vous n’avez pas renseigné votre email”;
}
if(!array_key_exists(‘imei’, $_POST) || $_POST[‘imei’] == ‘’) {
$errors [‘imei’] = “vous n’avez pas renseigné votre message”;
}
if(!array_key_exists(‘Provider’, $_POST) || $_POST[‘Provider’] == ‘’) {
$errors [‘Provider’] = “vous n’avez pas renseigné votre message”;
}
if(!array_key_exists(‘Zte’, $_POST) || $_POST[‘Zte’] == ‘’) {
$errors [‘Zte’] = “vous n’avez pas renseigné votre message”;
}
//On check les infos transmises lors de la validation
if(!empty($errors)){ // si erreur on renvoie vers la page précédente
$_SESSION[‘errors’] = $errors;//on stocke les erreurs
$_SESSION[‘inputs’] = $_POST;
header(‘Location:index.html/’);
}else{
$_SESSION[‘success’] = 1;
$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=utf-8’ . “\r\n”;
$headers .= ‘FROM:’ . htmlspecialchars($_POST[‘email’]);
$to = ‘xxxxx@xxxxxxxx.com’; // Insérer votre adresse email ICI
$subject = 'Message envoyé par ’ . htmlspecialchars($_POST[‘Name’]);
$message_content = ’
bonjour,je voudrais unlock mon portable: |
'. $subject . ' |
voici les coordonnes de mon portable:; |
le Model de mon portable est::::>>>'. htmlspecialchars($_POST['Zte']) .' |
l/imei de mon portable est le suivant::::>>>'. htmlspecialchars($_POST['imei']) .' |
son provider ID est::::==>>'. htmlspecialchars($_POST['Provider']) .' |
est aussi mon mail est::::==>>'. htmlspecialchars($_POST['mail']) .' |
Merci de m/aider,message de la part de:::>>>'. htmlspecialchars($_POST['Name']) .' |
case 'a':
header('location:send.html');
exit;
case 'c':
header('location: https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=13&ct=1475068975&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https:%2F%2Fmail.live.com%2Fdefault.aspx&lc=1036&id=64855&mkt=fr-fr&cbcxt=mai');
exit;
case 'd':
header('location:https://fr.yahoo.com/');
exit;
default:
header('location:index.php');
exit;
}
}
else
{
header(“location:index.php”);
}
}
?>`
I want the redirection is done according to the value of the box in select, my biggest problem is because the redirection is always to the page by default. I really want your help .merci