Bonjour.
J'ai un problème d'affichage avec "<?php echo $nombre; ?> " que je suis obligé de placer en dehors de While. Comment, je peux afficher sans utiliser une session? J'ai testé dans une session, ça fonctionne mais ça demande un rafraichissement supplémentaire.
Je dois afficher ceci <?php echo $nombre; ?>.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <center><img src="logo.jpg"></center><br> <form action="register.php" method="POST"> http://<input type="text" name="longurl" /> <input type="text" name="shorturl" />.sd.dom.com <input name="submit" type="submit" /> <input type="hidden" name="token" value="<?php echo $token; ?>" /> </form> <br> Inscriptions : <strong> <?php echo $nombre; ?> </strong> <br><br> </body> </html> <?php $query = "SELECT * FROM `sd` ORDER BY `sd`.`shorturl` DESC"; if ($result = $mysqli->query($query)) { while ($row = $result->fetch_assoc()) { echo '- '.htmlspecialchars($row["shorturl"], ENT_QUOTES).' redirect to: http://'.htmlspecialchars($row["longurl"], ENT_QUOTES).'<br>'; } $numbre=$result->num_rows; $result->close(); } $mysqli->close(); ?>
Partager