Handling PHP POST variable from other php file and managing $_SERVER["PHP_SELF"] -
i stucked @ problem can't figure out why isn't working.
i handling post variable php file:
$temp_variable = $_post['activity'];
after code process $temp_variable, try make button (still in same php file handled $_post['activity'])
echo '<form action="'.htmlspecialchars($_server["php_self"]).'" method="post">'; echo '<input type="submit" value="ok" name="process_more"/>'; echo '</form>';
then try catch ok button press, start activity:
if ($_server["request_method"] == "post") { $query = "delete table1 id = 5"; mysqli_query($conn,$query) }
my problem "delete from" part of code executes immediately, before user press "ok" button.
what can problem ?
check more specific form.
if(isset($_post['process_more'])){ if ($_post['process_more'] == 'ok') { // execute delete } }
$_server["request_method"]
equal 'post'
different form submission..
Comments
Post a Comment