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
| <?php
require_once("connexionMysql.inc.php");
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans nom</title>
</head>
<body>
<form id="monform" name="form1" method="post" action="">
<?php
$prenom = ( !empty($_POST['prenom'])) ? $_POST['prenom'] : '';
if(!empty($prenom))
{
$sql=$pdo->prepare( "SELECT prenom, mail FROM users WHERE prenom=:prenom" );
$sql->execute(array(':prenom'=>$prenom));
$row = $sql->fetch();
$email = $row['mail'];
}
else {
$email = '';
}
?>
<?php
$salle = ( !empty($_POST['lieu'])) ? $_POST['lieu'] : '';
$problemes = ( !empty($_POST['problemes'])) ? $_POST['problemes'] : '';
if(!empty($lieu)&&!empty($problemes))
{
$reqs=$pdo->prepare("INSERT INTO messages(N_ID, PRENOM, MAIL, LIEU, DATE, PROBLEMES) VALUES('',:prenom,:mail,:lieu,time(),:problemes)");
$req=$pdo->prepare($reqs);
$req->execute(array(
':prenom' =>$prenom,
':mail' => $mail,
':lieu' =>$lieu,
'time()'=>$date,
':problemes' => $problemes )) ;
}
?>
<p>
<table border="0" cellspacing="2" cellpadding="2">
<td>Prénom : </td>
<td><input type="text" name="prenom" id="prenom" value=""></td>
<tr align="center">
<td>Email : </td>
<td><input type="email" name="mail" id="mail" value="<?php echo $email ?>"</td>
</tr>
<td>Salle : </td>
<td><input type="text" name="lieu" id="lieu" value=""></td>
</table>
<p>
<label for="Problemes">
Veuillez renseigner le champs ci-dessous :
</label>
</br>
<textarea name="Problemes" id="Problemes" rows="10" cols="50"></textarea>
</p>
<p>
<label>
<input type="submit" name="bouton" value="Envoyer" />
</label>
</p>
<?php $sql->closeCursor() ; ?>
</form>
</body>
</html> |
Partager