bonjour j essaie depuis plusieurs jours d envoyer un mail a tous les membres apres l execution d un autre script que celui du mail
voila le script qui doit s executer avnt d envoyer le mail
et voici ma page mail.php
d avance merci
voila le script qui doit s executer avnt d envoyer le mail
<form action="components/create-clanwar.php" method="post" enctype="multipart/form-data" id="UploadForm">
<div class="col-md-6 col-md-offset-3 panel" style="padding-top:15px; border-radius:25px; border:solid #999 2px;">
<div class="col-md-10 col-md-offset-1">
<h4 class="text-center profile-text profile-name">Nom du clan</h4>
<div class="form-group float-label-control">
<input name="war_enemy" id="enemy_clan_name" class="form-control" type="text" placeholder="Nom du clan ennemi" required="required"></input>
<input name="war_warid" type="hidden"></input>
</div>
<hr>
<h4 class="text-center profile-text profile-name">nombre</h4>
<div class="form-group float-label-control">
<select name="war_size" class="form-control">
<option value="50" selected>50 vs 50</option>
<option value="45">45 vs 45</option>
<option value="40">40 vs 40</option>
<option value="35">35 vs 35</option>
<option value="30">30 vs 30</option>
<option value="25">25 vs 25</option>
<option value="20">20 vs 20</option>
<option value="15">15 vs 15</option>
<option value="10">10 vs 10</option>
</select>
</div>
<hr />
<h4 class="text-center profile-text profile-name">Démarrage de la guerre dans</h4>
<div class="form-inline text-center">
<input class="form-control" name="hours" step="1" min="0" max="23" value="23" style="width:60px" type="number">
heures et
<input class="form-control" name="minutes" step="1" min="0" max="59" value="59" style="width:60px" type="number">
minutes.
</div>
<hr />
<h4 class="text-center profile-text profile-name">Temps restant pour réserver</h4>
<div class="form-inline text-center">
<input class="form-control" name="call_timer" step="1" min="0" max="24" value="5" style="width:60px" type="number"> Heures
</div>
<hr />
<div class="form-group float-label-control">
<div class="submit">
<center>
<button class="btn btn-primary ladda-button" data-style="zoom-in" type="submit" id="SubmitButton" value="Upload" />Lancer la guerre</button>
</center>
</div>
</div>
</div>
</div>
</form>
et voici ma page mail.php
<?php
ini_set("display_errors",1);
if(isset($_POST)){
$username = htmlspecialchars($_REQUEST['username']);
require '../_database/database.php';
$sql3="SELECT * FROM user WHERE user_username='$username'";
$result = mysqli_query($database,$sql3);
$user = mysqli_fetch_array($result);
$one = $bdd->query("SELECT * FROM user WHERE user_email");
while ($ones = $one->fetch())
if(count($user)>=1){
header("location:../controllers/form/createwar-form.php?");
$message = "La guerre est declarée.";
$user_email = $user['user_email'];
$name = $user['user_firstname'];
$user_username = $user['user_username'];
$to = $user_email;
$email_body = 'Hi '.$user['user_username'].', <br/> <br/>Your UserName is '.$user['user_username'].' <br><br>La guerre est déclaré.N oublie pas de reserver ta cible et penses au remplissage des cdc. ';
$headers = 'Mime-Version: 1.0'."\r\n";
$headers .= 'Content-type: text/html; charset=utf-8'."\r\n";
$headers .= "\r\n";
mail($to,$email_subject,$email_body,$headers);
header("location:../controllers/form/createwar-form.php??send");
die();
}else{
header("location:../controllers/form/createwar-form.php?");
}
}
?>
d avance merci