-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcateg.php
More file actions
39 lines (36 loc) · 1.05 KB
/
Copy pathcateg.php
File metadata and controls
39 lines (36 loc) · 1.05 KB
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
<html>
<body>
<div class="grid_4">
<div id="forms" class="box" >
<form method="POST" ACTION="gest.php">
<fieldset>
<?php
$conn_string = "host=localhost port=5432 dbname=bastide user=andre password=loboG69";
$dbconn = pg_pconnect($conn_string);
if (!$dbconn) {
echo "An error occured.\n";
exit;
}
$num_nrs = pg_query ($dbconn, "SELECT nr_cat FROM categories order by nr_cat desc");
$num = pg_num_rows($num_nrs);
$i = 0;
$r = pg_fetch_result($num_nrs, $i, 0);
$nr= ++$r;
?>
<legend> AJOUTER une Catégorie :</legend>
<p>
<label>nr_cat :</label>
<input type="text" name="nrcatnew" value="<?php echo $nr;?>" maxlength="8" size=20 ></p>
<p>
<label>Nom :</label>
<input type="text" name="nom" size=20 ></p>
<p>
<label>Comentaires :</label>
<input type="text" name="coment" size=(20,3) ></p>
<INPUT class="register-button" type="submit" value="Valider"><INPUT class="register-button" type="reset">
</fieldset>
</form>
</div>
</div>
</body>
</html>