Fix costrutto + inserimento id nella tabella

This commit is contained in:
2026-01-16 11:36:56 +01:00
parent 0e3a3a15ba
commit 52749506a6

View File

@@ -1,15 +1,14 @@
<?php <?php
class User{ class User{
private $id; public $id;
private $name; public $name;
private $email; public $email;
/*
function set_details($id, $name, $email){ function __construct($id, $name, $email){
$this->id = $id; $this->id = $id;
$this->name = $name; $this->name = $name;
$this->email = $email; $this->email = $email;
} }
*/
} }
$file = fopen("data/clienti.csv", "r") or die("Non riesco a leggere il file, controlla che esista brutto rimbambito"); $file = fopen("data/clienti.csv", "r") or die("Non riesco a leggere il file, controlla che esista brutto rimbambito");
$utenti = []; $utenti = [];
@@ -37,6 +36,11 @@ fclose($file);
<th>Email</th> <th>Email</th>
<th>Link del cazzo</th> <th>Link del cazzo</th>
</tr> </tr>
<?php
for($i=0; $i<count($utenti); $i++){
echo "<tr><td>" . $utenti[$i]->id . "</td></tr>";
}
?>
</table> </table>
</body> </body>
</html> </html>