bonjour a tous
je suis a la recherche d un bon de commande en php a télécharger
cela fait des jours et des jours que je suis a la recherche
j ai essaye avec google mais je ne tombe que sur des formulaires
merci de l aide
Code : Tout sélectionner
<form action="pagephpquirecoilesdonnes.php" method="POST">
<input name="Nom">
<input name="Prenom">
<input etc.
<input type="submit" value="Envoyer!">
Code : Tout sélectionner
<?php
$nom = $_POST['Nom'];
$prenom = $_POST['Prenom'];
$link = new mysqli('localhost', 'user', 'password', 'MonSite');
$link->set_charset('utf8mb4');
/* Vérification de la connexion */
if (mysqli_connect_errno()) {
printf("Connexion échouée : %s\n", mysqli_connect_error());
exit();
}
$stmt = $link->prepare("INSERT INTO `commandes` (nom, prenom, etc) VALUES (?, ?...)");
if (!$stmt->bind_param("ss",$nom, $prenom)) {
echo "Echec lors du liage des paramètres : (" . $stmt->errno . ") " . $stmt->error;
}
if (!$stmt->execute()) {
echo "Echec lors de l'exécution : (" . $stmt->errno . ") " . $stmt->error;
}
mysqli_close($link);
Code : Tout sélectionner
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
<link rel="stylesheet" href="https://peche-a-la-perle.000webhostapp.com/peche/css/style.css">
<script type="text/javascript" src="https://peche-a-la-perle.000webhostapp.com/peche/js/style.js"></script>
</head>
<body>
Remplir le formulaire pour valider votre commande
<form action="inscription.php" method="post">
<fieldset class="coordonnees">
<legend>Vos Coordonnées</legend>
<label for="nom">Nom</label>
<input id="nom" name="nom" pattern="[a-Z]{*}" type="text" si>
<br>
<label for="prenom">Prénom</label>
<input id="prenom" name="prenom" type="text">
<br>
<label for="mail">mail</label>
<input id="mail" name="mail" type="text">
<br>
<label for="mail_conf">Confirmer mail</label>
<input id="mail_conf" name="Confirmer mail" type="text">
<br>
<legend>Adresse</legend>
<label>Rue</label>
<input id="rue" name="rue" type="text">
<br>
<label>Code postal</label>
<input id="code-postal" name="code-postal" type="text"><br>
<label>Ville</label>
<input id="ville" name="ville" type="text"><br>
</fieldset>
<fieldset class="Votre commande">
<legend>Votre commande</legend>
<title> Tableau de commande </title>
<table border="1" id="TableID" style="width: 350pxpx;">
<tr>
<th bgcolor="grey" td="" width="15"></th><th bgcolor="grey" td="" width="90">Séance</th><th bgcolor="grey" td="" width="90">Référence</th><th bgcolor="grey" td="" width="75">Format</th><th bgcolor="grey" td="" width="45">Impression</th><th bgcolor="grey" td="" width="45">Quantité</th><th bgcolor="grey" td="" width="45">Tarif</th></tr>
<tr>
<td><input name="chk" size="15" type="checkbox" /></td>
<td>
<select name="Séance" style="width: 90;">
<option selected="" value="Choix">Sélectionner votre séance</option>
<option selected="" value="Séance 1">Séance 1</option>
<option value="Séance 2">Séance 2Séance 2</option>
</select>
<td><input name="Ref" size="25" type="text" /></td>
<td>
<select name="Format" style="width: 90;">
<option value="10*15">10*15</option>
<option value="11*15">11*15</option>
<option value="20*30">20*30</option>
</select>
</td>
<td>
<select name="Impression" style="width: 10;">
<option value="Mat">Mat</option>
<option value="Brillant">Brillant</option>
<option value="Satiné">Satiné</option>
</select>
</td>
<td>
<select name="Quantité" style="width: 20;">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</td>
<td><input name="Prix" readonly="" type="text" /></td>
</td></tr>
</table>
</fieldset>
<input onclick="addRow('TableID')" type="button" value="Ajouter" />
<input onclick="deleteRow('TableID')" type="button" value="Supprimer" />
</body>
</html>Code : Tout sélectionner
function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var colCount = table.rows[0].cells.length;
for(var i=0; i<colCount; i++) {
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[1].cells[i].innerHTML;
//alert(newcell.childNodes);
switch(newcell.childNodes[0].type) {
case "text":
newcell.childNodes[0].value = "";
break;
case "checkbox":
newcell.childNodes[0].checked = false;
break;
case "select-one":
newcell.childNodes[0].selectedIndex = 0;
break;
}
}
}
function deleteRow(tableID) {
try {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
for(var i=0; i<rowCount; i++) {
var row = table.rows[i];
var chkbox = row.cells[0].childNodes[0];
if(null != chkbox && true == chkbox.checked) {
if(rowCount <= 2) {
addRow(tableID);
// alert("Attention la 1ère ligne n'est pas supprimable. La quantité est initialisée à 0");
// break;
}
table.deleteRow(i);
rowCount--;
i--;
}
}
}catch(e) {
alert(e);
}
}
function testValue(selection) {
if (selection.value == "Dawn") {
// do something
}
else if (selection.value == "Noon") {
// do something
}
else if (selection.value == "Dusk") {
// do something
}
else {
// do something
}
}
Code : Tout sélectionner
<?php
ini_set('display_errors', 1);
error_reporting(-1);
?>
<?php
date_default_timezone_set('Europe/Paris');
/*ton script doit etre sur un hebergeur qui supporte le php 5 de préférence*/
/*remplace [email protected] entre les doubles guillemets*/
$tonemail="[email protected]"; /**/
/*à toi de définir ta page de retour aprés envoi du mail*/
$site="https://peche-a-la-perle.000webhostapp.com/";
/*pas toucher*/
$headers = "From: <$tonemail>\n";
$headers .= "Reply-To: $tonemail\n";
$headers .= "MIME-version: 1.0\n";
$headers .= "Content-type: text/html; charset= iso-8859-1\n";
$message="";
$sujet = "question depuis mon site http://???"; /*si tu veux mettre quelque chose*/
if(isset($_POST['sub']) && $_POST['sub']==="Envoyer") {
$mode_envoi = "La Poste"; //vaut la poste sauf ...
$message.='<br> Un client a poser une question. Voici le recapitulatif du bon de commande : <br><br>
prenom : '.$_POST["prenom"].' <br>
email : '.$_POST["email"].' <br>
code postal : '.$_POST["code_postal"].' <br>
ville : '.$_POST["ville"].' <br>
pays : '.$_POST["pays"].' <br>
commentaires: '.$_POST["commentaires"].' <br>
<b>----------------------------------</b><br>';
$message.="<hr>Le ".date('d-m-Y H:i:s')." par ip du client : ".$_SERVER['REMOTE_ADDR']."<hr>";
if(mail($tonemail,$sujet,$message,$headers)){
echo '
<br><center><b><h2>Nous vous remercions pour votre question qui a bien été enregistrée .</h2></b> </center><br>
<br><center><b><h3>vous recevrez d ici peu , une reponse.</h3></b> </center><br>
<br><center><b><h2><a target="_blank" href="https://peche-a-la-perle.000webhostapp.com/essaiform.php">cliquez ici pour revenir au bon de commande</a></h2></b> </center><br>
';
/******* Vérification
foreach( $send as $value )
echo $value . '<br />';
********/
//$site="https://peche-a-la-perle.000webhostapp.com/"; /*à toi de définir ta page*/
// echo '<br><center><b><h2>Pour revenir au site <a href="'.$site.'" >ici</a></h2></b></center> ';
exit;
}else{
echo 'PROBLEME FONCTION MAIL PHP';exit;
}
}else{
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<!-- DEBUT DU SCRIPT -->
<STYLE TYPE="text/css">
<!--
#cache {
position:absolute; top:200px; z-index:20; visibility:hidden;
}
-->
</STYLE>
<DIV ID="cache"><TABLE WIDTH=400 BGCOLOR=#FFFFFF BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><TABLE WIDTH=100% BGCOLOR=#FF9900 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><FONT FACE="Verdana" SIZE=4 COLOR=#FFFFFF><B><I><BR>dans quelques instants votre formulaire pour poser une question va s'afficher<BR><BR></I></B></FONT></TD> </TR></TABLE></TD> </TR></TABLE></DIV>
<script type="text/javascript" src="https://peche-a-la-perle.000webhostapp.com/peche/js/styleformulaire-2.js"></script>
<script type="text/javascript" src="https://peche-a-la-perle.000webhostapp.com/peche/js/styleformulaire.js"></script>
<script type="text/javascript" src="https://peche-a-la-perle.000webhostapp.com/peche/js/style.js"></script>
<link rel="stylesheet" href="https://peche-a-la-perle.000webhostapp.com/peche/css/style1.css">
<style type="text/css">
body {
background-color: #72ACDC;
}
</style>
<title>Formulaire</title>
<META content="text/html; charset=windows-1252" http-equiv="Content-Type">
</head>
<BODY background="Bon de commande JAVASCRIPT (Copyright Crash Computing 2011)_fichiers/index.htm" bgcolor="#008000">
<CENTER>
<table width="800" height="150" cellspacing="1" border="1">
<tbody>
<tr width="800" >
<form id="F_COMMANDE" action="https://peche-a-la-perle.000webhostapp.com/essaiform.php" onSubmit="return Verifie(this)" method="post">
<img alt="" src="http://p3.storage.canalblog.com/32/23/1093017/87294056_o.jpg"width="800">
</tr>
<tr>
<th width="800" height="23" bgcolor=#EBE0EF align="center" colspan="5"><font color="noir">Veuillez entrer vos coordonnees </font></th>
</tr>
<tr>
<td width="420" height="24" bgcolor=#ffffff colspan="2"><font color="noir">Prenom ou peusdo</font></td>
<td width="330" height="24" bgcolor=#ffffff colspan="3"><input size="34" name="prenom"><img align="absmiddle" id="prenom_ife_marker_1" src="chrome://informenter/skin/marker.png" class="ife_marker" style="border: 0pt none; width: 14px; height: 19px; cursor: pointer; display: inline;" title="La longueur du champ est inconnue"></td>
</tr>
<tr>
<td width="420" height="33" bgcolor=#ffffff colspan="2"><font color="noir">Adresse E-mail</font></td>
<td width="330" height="33" bgcolor=#ffffff colspan="3"><input value="@" size="33" name="email"><img align="absmiddle" id="email_ife_marker_2" src="chrome://informenter/skin/marker.png" class="ife_marker" style="border: 0pt none; width: 14px; height: 19px; cursor: pointer; display: inline;" title="La longueur du champ est inconnue"></td>
</tr>
<tr>
<td width="420" height="24" bgcolor=#ffffff colspan="2"><font color="noir">Code postal</font> </td>
<td width="330" height="24" bgcolor=#ffffff colspan="3"><input size="34" name="code_postal"><img align="absmiddle" id="code_postal_ife_marker_4" src="chrome://informenter/skin/marker.png" class="ife_marker" style="border: 0pt none; width: 14px; height: 19px; cursor: pointer; display: inline;" title="La longueur du champ est inconnue"></td>
</tr>
<tr>
<td width="420" height="24" bgcolor=#ffffff colspan="2"><font color="noir">Ville</font></td>
<td width="330" height="24" bgcolor=#ffffff colspan="3"><input size="34" name="ville"><img align="absmiddle" id="ville_ife_marker_6" src="chrome://informenter/skin/marker.png" class="ife_marker" style="border: 0pt none; width: 14px; height: 19px; cursor: pointer; display: inline;" title="La longueur du champ est inconnue"></td>
</tr>
<tr>
<td width="420" height="24" bgcolor=#ffffff colspan="2"><font color="noir">Pays</font></td>
<td width="330" height="24" bgcolor="#ffffff" colspan="3">
<select name="pays">
<option value="France">France</option>
<option value="Allemagne">Allemagne</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Afrique du Sud">Afrique du Sud</option>
<option value="Albani">belgique</option>
</select></td>
</tr>
<TR>
<TD colspan="5"bgcolor= #f7dfff><center><font color="noir">Une question </font></center></TD>
</tr>
<TR>
<TD colspan="5" bgcolor=#ffffff>
<center><TEXTAREA rows="5" cols="60"name="commentaires">Poster votre question ici</TEXTAREA></center>
</TD>
</TR>
</tbody>
</table>
<title> Tableau de commande </title>
<table border="1" id="TableID" style="width: 350pxpx;">
<tr>
<th bgcolor="grey" td="" width="15"></th><th bgcolor="grey" td="" width="210">Séance</th><th bgcolor="grey" td="" width="210">Référence</th><th bgcolor="grey" td="" width="45">Quantité</th><th bgcolor="grey" td="" width="45">Tarif</th></tr>
<tr>
<td><input name="chk" size="15" type="checkbox" /></td>
<td>
<select name="Séance" style="width: 210;">
<option selected="" value="Choix">Sélectionner votre séance</option>
<option selected="" value="Séance 1">Séance 1</option>
<option value="Séance 2">Séance 2Séance 2</option>
</select>
<td><input name="Ref" size="25" type="text" /></td>
<td>
<select name="Quantité" style="width: 20;">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</td>
<td><input name="Prix" readonly="" type="text" /></td>
</td></tr>
</table>
</fieldset>
<input onclick="addRow('TableID')" type="button" value="Ajouter" />
<input onclick="deleteRow('TableID')" type="button" value="Supprimer" />
<input type="submit" value="Envoyer" name="sub">
</form>
</CENTER>
</BODY>
</HTML>
<!-- Hosting24 Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->
Code : Tout sélectionner
function Verifie(aBC)
{
if(aBC.nom.value == ""){
alert('Vous n\'avez pas renseign\351 votre nom.');
return false;
}else if(aBC.prenom.value == ""){
alert('Vous n\'avez pas renseign\351 votre prenom.');
return false;
}else if(aBC.adresse.value == ""){
alert('Vous n\'avez pas renseign\351 votre adresse,N°.');
return false;
}else if(aBC.code_postal.value == ""){
alert('Vous n\'avez pas renseign\351 votre code postal.');
return false;
}else if(aBC.ville.value == ""){
alert('Vous n\'avez pas renseign\351 votre ville .');
return false;
}else if(aBC.telephone.value == ""){
alert('Vous n\'avez pas renseign\351 votre numero de telephone .');
return false;
}else if(aBC.pays.value == ""){
alert('Vous n\'avez pas renseign\351 votre pays.');
return false;
}else if(aBC.email.value == ""){
alert('Vous n\'avez pas renseign\351 votre email.'); return false;
} else{
var regMail = new RegExp('^[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*[\.]{1}[a-z]{2,6}$', 'i');
// var regCP = /^[0-9]{4}$/; //Vérif code postal benelux
if(regMail.test(aBC.email.value))
{
return true;
}else
{
alert('Vous devez renseign\351 une adresse e-mail corecte.');
return false;
}
/*if(regCP.test(aBC.email.value)) ///////////Verif Code Postal Benelux
{
return true;
}else
{
alert('Vous devez renseign\351 un Code postal correct !');
document.ex.cp.focus();
return false;
}*/
}
}
Code : Tout sélectionner
/*
SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
http://www.editeurjavascript.com
*/
var nava = (document.layers);
var dom = (document.getElementById);
var iex = (document.all);
if (nava) { cach = document.cache }
else if (dom) { cach = document.getElementById("cache").style }
else if (iex) { cach = cache.style }
largeur = screen.width;
cach.left = Math.round((largeur/2)-200);
cach.visibility = "visible";
function cacheOff()
{
cach.visibility = "hidden";
}
window.onload = cacheOffCode : Tout sélectionner
.coordonnees label {
display: inline-block;
width: 130px;
}
.coordonnees input {
margin: 2px 0;
padding: 2px;
width: 300px;
}
.coordonnees legend {
font-weight: bold;
margin: 10px 0;
font-size: 18px;
}