<?php $product_repo = new ProductRepository(); $e = $product_repo->get_by_id($_GET['id']); if (is_null($e)) { header('location:index.php?page=aproduct'); } ?> <h3>Edit Product</h3> <form method="post" action="<?php $_SERVER['PHP_SELF']; ?> "> <div class="form-group"> <input type="text" class="form-control" id="name" name="name" placeholder="Name" value="<?php echo $e->get_name(); ?> "> </div> <div class="form-group"> <input type="text" class="form-control" id="description" name="description" placeholder="Description" value="<?php echo $e->get_description(); ?> "> </div> <div class="form-group"> <input type="text" class="form-control" id="sell_price" name="sell_price" placeholder="Sell Price" value="<?php echo $e->get_sell_price(); ?> "> </div>