mysql - Php isset not working after button click -
for reason when click cancel button should run through cancel isset mysql query doesn't. passes through mysql query when make $_get instead of $_post. not entirely sure whats happening.
if(isset($_post["cancel"])) { $scancel = $dbh->prepare(" update materialorders set `cancelledbyuid` = :uid, `cancelled` = 'true' `idmaterialorders` = :idmaterialorders "); $scancel->bindvalue(":uid", $_session["uid"]); $scancel->bindvalue(":idmaterialorders", $_get["oid"]); if ($scancel->execute()) { $scancel->closecursor(); }
}
<a href="includes/orderitems.php?cancel=true&oid=<?php print $_get['oid']; ?>" class="suppliermaterial" target="_blank"> <input type="button" value="cancel order" name="cancel" id="cancel">
since implementing when link clicked, use $_get because use $_post, form must submitted in post method. please try this,
<a href="includes/orderitems.php?cancel=true&oid=<?php print $_get['oid']; ?>" class="suppliermaterial" target="_blank"> <input type="button" value="cancel order" name="cancel" id="cancel"> </a>
Comments
Post a Comment