Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title> Inserimento prodotto </title>
- <meta charset="utf-8">
- <link rel="stylesheet" href="stili.css" type="text/css" />
- </head>
- <body>
- <?php
- $nomehost="localhost";
- $username="root";
- $password="root";
- $connessione=mysql_connect($nomehost,$username,$password) or die(mysql_error());
- $nomedb="gestionale";
- $selezione=mysql_select_db($nomedb,$connessione) or die(mysql_error());
- $nomeprod=$_GET["nomeprod"];
- $categoriaprod=$_GET["categoriaprod"];
- $prezzoprod=$_GET["prezzoprod"];
- $sql="INSERT INTO prodotti1 (nomeprod,categoriaprod,prezzoprod)
- VALUES ('$nomeprod','$categoriaprod','$prezzoprod')";
- $risultato= mysql_query($sql) or die (mysql_error()) ;
- $query="SELECT * FROM prodotti1 order by codiceprod";
- $elementi=mysql_query($query) or die (mysql_error());
- echo("<table style='border:1px solid black'>
- <tr> <td> Modifica </td> <td> Elimina </td> <td> Codice </td> <td> Nome </td> <td> Categoria </td> <td> Prezzo </td> <tr/>");
- while($riga=mysql_fetch_array($elementi))
- echo("<tr> <td> <a href=\"modificahome.php?codiceprod=$riga[codiceprod]&nomeprod=$riga[nomeprod]\"> <img src='images/edit.jpg' width='55px' height='55px'> </a></td> <td> <a href=\"eliminaprodotti.php?codiceprod=$riga[codiceprod]\"> <img src='images/elimina.png' width='55px' height='55px'> </a> </td> <td> $riga[codiceprod] </td> <td> $riga[nomeprod] </td> <td> $riga[categoriaprod] </td> <td> $riga[prezzoprod] € </td> </tr>");
- echo("</table>");
- ?>
- <a href="home.html"> Back to home </a>
- </body>
- </html>
Add Comment
Please, Sign In to add comment