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
| <?php
session_start();
$log = $_POST['login'];
?>
<html>
<head>
<title> Site Commercial </title>
<link rel="stylesheet" type="text/css" href="MonStyle.css"/>
</head>
<body>
<div class="head1"></div>
<div class="head2">
<a href="index.php" title="Retour à l'accueil">Accueil</a>
<a href="conseil.php" title="Retour à l'accueil">conseil</a>
<a href="panier.php" title="Retour à l'accueil">panier</a>
<a href="compte.php" title="Retour à l'accueil">compte</a>
</div>
<div class="gauche">
<p>
<table>
<td>
<table border = 1 width="100%">
<tr>
<td>
<center>
<?php
if($_SESSION['login']!="")
{
echo("Utilisateurs<br>");
echo $_SESSION['login'];
echo("est actuellement connecté(e)<br>");
}
else
{
echo("<h3>Utilisateurs<br></h3>");
?>
<form action = "index.php" Method="post">
<p>Login : <input type ="text" name ="login" value ="">
<p>mot de passe : <input type = "pass" name ="pass" value ="">
<p><input type ="submit" value ="valider">
</form>
<?php
}
?>
</td>
</center>
</table>
</p>
<p>
<table>
<td>
<table border=1 width="100%">
<tr>
<td>
<center>
<p><h3>Recherche</h3></p>
<form action="recherche.php" method="post">
<p><input type="text" name="rech" value=""></p>
<p><input type="submit" value="Rechercher"></p>
</form>
</center>
</td>
</table>
</p>
<p>
<center>
<table>
<td>
<table border="1" width="100%" align="center">
<tr>
<td>
<center>
<p><h3>Catégories</p></h3>
<?php
//connection au SGBD et à la base de données
$lien=mysql_connect("localhost","root","") or die("Connexion impossible");
mysql_select_db("ecommerce",$lien) or die("Connexion à la base impossible");
//requête récupérant la liste des catégories
$requcateg=mysql_query("Select * From categorie",$lien)
or die("erreur requête catégories");
while($resultcateg=mysql_fetch_row($requcateg))
{
echo("<a href='".$resultcateg[1].".php'>".$resultcateg[1]."</a><br>");
}
mysql_close($lien);
?>
</center>
</td>
</table>
</center>
</p>
</div>
<div class="centre">
<h1>toto</h1>
</div>
</body>
</html> |