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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -