Voilà, je n'arrive pas à transférer des données dans une Popup. Pourriez-vous m'aider ?
Formulaire (form.php) :
Code : Tout sélectionner
<html>
<head>
<SCRIPT LANGUAGE="javascript">
function verif_infos(){
champ1=document.formulaire.nomcli.value
champ2=document.formulaire.prenomcli.value
champ3=document.formulaire.ruecli.value
champ4=document.formulaire.CPcli.value
champ5=document.formulaire.villecli.value
if((champ1.length<1)||(champ2.length<1)||(champ3.length<1)||(champ4.length<1)||(champ5.length<1))
{
alert ('Veuillez renseigner les champs obligatoires !');
}
else
{
document.formulaire.submit();
}
}
</SCRIPT>
</head>
<title>Formulaire d'inscription</title>
<body>
<img src="logo.jpg">
<center>
<h1><strong>Formulaire d'inscription</strong></h1>
<strong>Afin de pouvoir profiter de nos services, veuillez remplir le formulaire ci-dessous.</strong>
<br><br>
<form action="infos.php" method="post" name="formulaire">
Nom : <input type="text" name="nomcli" size="12">
Prénom : <input type="text" name="prenomcli" size="12"><br><br>
Adresse : <input type="text" name="ruecli" size="45"><br><br>
Code Postal : <input type="int" name="CPcli" size="4">
Ville : <input type="text" name="villecli" size="12"><br><br>
Mode de paiement : <input type="radio" name="mode_pay" value="cb" checked>Carte Bancaire
<input type="radio" name="mode_pay" value="chq">Chèque
<br><br><br>
<input type="button" value="Valider" onClick="verif_infos()">
<input type="reset" value="Annuler">
</form>
</center>
</body>
</html>Code : Tout sélectionner
<html>
<head>
<title>Confirmation de l'inscription</title>
<script language="javascript">
<!--
function recap()
{
window.open ("recap.php", "recap", "toolbar=no, location=no, directories=no, status=yes, scrollbars=yes, resizable=no, copyhistory=no, width=400, height=400, left=300, top=50");
}
//-->
</script>
</head>
<body>
<img src="logo.jpg">
<center><h1><strong>Confirmation de l'inscription</strong></h1>
<strong>Merci de vous être inscrit(e) à notre offre !</strong>
<br>
<strong>Il est recommandé d'imprimer les informations suivantes afin d'avoir un support en cas de réclamation.</strong>
<br> <br> <br>
<?php
$nomcli = $_POST['nomcli'];
$prenomcli = $_POST['prenomcli'];
$ruecli = $_POST['ruecli'];
$CPcli = $_POST['CPcli'];
$villecli = $_POST['villecli'];
$mode_pay = $_POST['mode_pay'];
$connexion = mysql_pconnect("localhost", "root", "") or die("erreur");
mysql_select_db("bd_site", $connexion) or die ("échec");
$reqSQL="INSERT INTO client (nomcli, prenomcli, ruecli, CPcli, villecli, mode_pay) VALUES ('$nomcli', '$prenomcli', '$ruecli', '$CPcli', '$villecli', '$mode_pay')";
mysql_query($reqSQL, $connexion);
mysql_close($connexion);
?>
<form action="recap.php" method="post" name="recapitulatif">
<input type="button" value="Imprimer le récapitulatif" onclick="recap()">
<input type="hidden" value="<? echo $nomcli ?>" name="nomcli">
<input type="hidden" value="<? echo $prenomcli ?>" name="prenomcli">
<input type="hidden" value="<? echo $ruecli ?>" name="ruecli">
<input type="hidden" value="<? echo $CPcli ?>" name="CPcli">
<input type="hidden" value="<? echo $villecli ?>" name="villecli">
<input type="hidden" value="<? echo $mode_pay ?>" name="mode_pay">
</form>
<?
print("<br><br><strong>Nom :</strong> $nomcli <strong>Prénom :</strong> $prenomcli");
print("<br><strong>Adresse :</strong> $ruecli $CPcli $villecli");
print("<br><strong>Mode de paiement :</strong> $mode_pay");
?>
<br><br><br>
<Table Border=0>
<form method="post" action="valid_infos.php">
<input type="submit" value="Valider">
</form>
<form method="post" action="http://dr-bug.com/">
<input type="submit" value="Accueil">
</form>
</table>
</center>
</body>
</html>Code : Tout sélectionner
<html>
<head>
<title>Récapitulatif</title>
</head>
<body>
<center>
<img src="logo.jpg">
<?php
$client[0] = $_POST['nomcli'];
$client[1] = $_POST['prenomcli'];
$client[2] = $_POST['ruecli'];
$client[3] = $_POST['CPcli'];
$client[4] = $_POST['villecli'];
$client[5]= $_POST['mode_pay'];
?>
<table cellspacing='15'>
<tr>
<td colspan='3'>
<?php
echo "<strong>Nom :</strong> $client[0]";
echo "<strong> Prénom :</strong>$client[1]<br>";
echo "<strong>Adresse :</Strong> $client[2]";
echo " $client[3]";
echo " $client[4]<br>";
echo "<strong>Mode de Paiement :</strong> $client[5]<br>";
?>
</td>
<tr>
</table>
<form>
<input type="button" value="Imprimer" onclick="window.print()">
</form>
</center>
</body>
</html>