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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
| <?php session_start();
if(isset($_SESSION['login']))
echo 'La variable "login" existe et vaut: ' . $_SESSION['login'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Creation et modification coordonnées bancaires</title>
</head>
<body>
<br>
<table style="text-align: left; width: 1306px; height: 30px;" border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="background-color: rgb(153, 51, 153);" colspan="3" rowspan="1"><small style="color: rgb(255, 255, 255); font-weight: bold;"><span style="font-family: Arial;">> vos comptes bancaires</span></small></td>
</tr>
</tbody>
</table>
<br>
<form method="post" action="insertion_compte.php" name="compte_bancaire"><br>
<table style="background-color: rgb(204, 255, 255); width: 667px; height: 74px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="font-family: Arial; text-align: center;"><small>Nom
ou raison sociale du titulaire</small></td>
<td style="font-family: Arial; text-align: center;"><small>Code<br>
Banque</small></td>
<td style="font-family: Arial; text-align: center;"><small>Code
Guichet</small></td>
<td style="font-family: Arial; text-align: center;"><small>Numéro
de compte</small></td>
<td style="font-family: Arial; text-align: center;"><small>Clé</small></td>
</tr>
<tr>
<td style="font-family: Arial; text-align: center;"><small><input name="raison_sociale"></small></td>
<td style="font-family: Arial; text-align: center;"><small><input maxlength="5" name="banque"></small></td>
<td style="font-family: Arial; text-align: center;"><small><input maxlength="5" name="guichet"></small></td>
<td style="font-family: Arial; text-align: center;"><small><input maxlength="11" name="compte"></small></td>
<td style="font-family: Arial; text-align: center;"><small><input maxlength="2" name="cle"></small></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td><input value="Valider" type="submit"></td>
</tr>
</tbody>
</table>
<br>
<br>
<?php
//connection au serveur:
$cnx = mysql_connect( "sql.olympe-network.com", "xxx", "xxx" ) ;
//sélection de la base de données:
$db = mysql_select_db( "120460_connexion" ) ;
//création de la requête SQL:
$sql = mysql_query('INSERT INTO coordonnees_bancaires (utilisateur)
VALUES ( "'.$_SESSION['login'].'");');
?>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</form>
</body>
</html>
Code pour le fichier php : insertion_compte.php
<?php
//connection au serveur:
$cnx = mysql_connect( "sql.olympe-network.com", "xxx", "xxxx" ) ;
//sélection de la base de données:
$db = mysql_select_db( "120460_connexion" ) ;
//récupération des valeurs des champs:
//raison sociale:
$raison_sociale = $_POST["raison_sociale"] ;
//banque:
$banque = $_POST["banque"] ;
//guichet:
$guichet = $_POST["guichet"] ;
//numero de compte:
$compte = $_POST["compte"] ;
//cle:
$cle = $_POST["cle"] ;
//création de la requête SQL:
$sql = "INSERT INTO coordonnees_bancaires (raison_sociale, banque, guichet, compte, cle)
VALUES ('$raison_sociale', '$banque', '$guichet', '$compte', '$cle')" ;
//exécution de la requête SQL:
$requete = mysql_query($sql, $cnx) or die( mysql_error() ) ;
//affichage des résultats, pour savoir si l'insertion a marchée:
if($requete)
{
echo("L'insertion a été correctement effectuée") ;
}
else
{
echo("L'insertion à échouée") ;
}
?> |
Partager