Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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
    }
?>
Comment

PREVIOUS NEXT
Code Example
Php :: onclick call route laravel 
Php :: laravel select only some columns relationship 
Php :: genrate file name in php 
Php :: trim array in map php 
Php :: in array php multiple values 
Php :: php function comment 
Php :: laravel log path 
Php :: composer update php mbstring.so missing 
Php :: delete route method in laravel 
Php :: join array in php as string 
Php :: wordpress logout 
Php :: upload_max_filesize in wordpress 
Php :: How to get the current taxonomy term ID (not the slug) in WordPress? 
Php :: laravel collection put 
Php :: use multiple pagination in same page laravel 
Php :: limited text show in laravel 
Php :: how to fix PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted 
Php :: send data from php to python 
Php :: php even odd program 
Php :: php convert to string 
Php :: if condition view page of laravel 
Php :: laravel validate datetime with datetime-local 
Php :: php mysql prepare query 
Php :: week day php 
Php :: laravel select max value 
Php :: php number format comma and decimal 
Php :: this page isn t working http error 500 laravel on server 
Php :: get from table laravel 
Php :: php mongodb 
Php :: static function model laravel 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =