output dei valori già esistenti per modificarli nella pagina edit (parte 134)
1 files added
2 files modified
| | |
| | | <body> |
| | | <h1>Edit Product</h1> |
| | | |
| | | <form method="post" action="/products/<?= $product["id"]?>/update"> |
| | | <?php require "form.php"?> |
| | | </form> |
| | | |
| | | <p><a href="/products/<?= $product["id"] ?>/show" >Cancel</a></p> |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <label for="name">Name</label> |
| | | <input type="text", id="name", name="name" value="<?= $product["name"] ?? ""?>"> |
| | | |
| | | <?php if (isset($errors["name"])): ?> |
| | | <p><?= $errors["name"] ?></p> |
| | | <?php endif; ?> |
| | | |
| | | <label for="description">Description</label> |
| | | <textarea id="description", name="description"><?= $product["description"] ?? ""?></textarea> |
| | | |
| | | <button>Save</button> |
| | |
| | | <body> |
| | | <h1>New product</h1> |
| | | <form method="post" action="/products/create"> |
| | | <label for="name">Name</label> |
| | | <input type="text", id="name", name="name"> |
| | | |
| | | <?php if (isset($errors["name"])): ?> |
| | | <p><?= $errors["name"] ?></p> |
| | | <?php endif; ?> |
| | | |
| | | <label for="description">Description</label> |
| | | <textarea id="description", name="description"></textarea> |
| | | |
| | | <button>Save</button> |
| | | <?php require "form.php"?> |
| | | </form> |
| | | </body> |
| | | </hmtl> |