Replace insertClient.php

parent debf0f6c
<?php <!DOCTYPE html>
// Connexion à la base de données <html>
$vNom = $_GET['nom']; <head>
$vPrenom = $_GET['Prenom']; <meta charset="utf-8">
$vddn = $_GET['ddn']; <title>Insert Client </title>
$vadd = $_GET['add']; </head>
$vTel = $_GET['nTel']; <body>
<table border = "1">
<tr>
<th> id </th>
<th> nom </th>
<th>prenom</th>
<th> ddn </th>
<th> adresse </th>
<th> numero </th>
</tr>
<?php
$vHost = 'tuxa.sme.utc'; $vHost = 'tuxa.sme.utc';
$vPort = '5432'; $vPort = '5432';
$vData = 'dbbdd0p020'; $vData = 'dbbdd0p020';
$vUser = 'bdd0p020'; $vUser = 'bdd0p020';
$vPass = 'uLd6pAgM'; $vPass = 'uLd6pAgM';
$nom = $_POST('nom');
$prenom = $_POST('prenom');
$ddn = $_POST('ddn');
$add = $_POST('add');
$ntel = $_POST('ntel');
$vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass); $vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
if($vNom) $vSql ='INSERT INTO client (nom, prenom, ddn, adresse, numeero) VALUES('$nom', '$prenom', '$ddn', '$add', '$ntel')';
{ $vSt = $vConn->prepare($vSql);
if($vPrenom)
{
if($vddn)
{
if($vTel)
{
$query = "INSERT INTO client(nom, prenom, ddn, adresse, numero) VALUES('$vNom', '$vPrenom', '$vddn', '$vadd', '$vTel')";
$vSt = $vConn->prepare($query);
$vSt->execute(); $vSt->execute();
$query = "SELECT * FROM client"; $vSql ='SELECT * FROM client';
$vSt = $vConn->prepare($query); $vSt = $vConn->prepare($vSql);
$vSt->execute(); $vSt->execute();
while ($vResult = $vSt->fetch(PDO::FETCH_ASSOC)) { while ($vResult = $vSt->fetch(PDO::FETCH_ASSOC)) {
echo '<tr>'; echo '<tr>';
echo "<td>$vResult[__________]</td>"; echo "<td>$vResult[idClient]</td>";
echo "<td>$vResult[__________]</td>"; echo "<td>$vResult[nom]</td>";
echo "<td>$vResult[__________]</td>"; echo "<td>$vResult[prenom]</td>";
echo "<td>$vResult[ddn]</td>";
echo "<td>$vResult[adresse]</td>";
echo "<td>$vResult[numero]</td>";
echo '</tr>'; echo '</tr>';
} }*/
?>
echo "Insertion Correct"; </table>
}
}
}
}
?>
<html>
<head> <title> Insert Client </title> </head>
<body>
<table border = "1">
<tr> <th>id</th> <th> Nom </th> <th> Prenom </th> <th> Date </th> <th> Adresse </th> <th> Numero </th> </tr>
</table>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment