form action on same page in php
<form action="<php echo $_SERVER['php_shelf'] ?>" method="POST">
<--
Your inputs here
--!>
</form>
<?php
if(isset($_POST['your input name']){
$input = $_POST['input name'];
}
?>
form action on same page in php
<form action="<php echo $_SERVER['php_shelf'] ?>" method="POST">
<--
Your inputs here
--!>
</form>
<?php
if(isset($_POST['your input name']){
$input = $_POST['input name'];
}
?>
how to submit same form for different purpose using two submit button in php
Give each input a name attribute. Only the clicked input's name attribute will be sent to the server.
<input type="submit" name="publish" value="Publish">
<input type="submit" name="save" value="Save">
And then
<?php
if (isset($_POST['publish'])) {
# Publish-button was clicked
}
elseif (isset($_POST['save'])) {
# Save-button was clicked
}
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us