adit
adit

Reputation: 33674

value of input from PHP postback

I have the following code:

<form>
   .............
    <?php
    if (!isset($_FILES['before']['name'] || !isset($_FILES['after']['name']) 
        echo '<input type="submit" value="Show Image">'
    else 
        echo '<input type="submit" value="Upload">'
    ?>
</form>

in my postback how do I check whether it's one or the other?

Upvotes: 0

Views: 150

Answers (1)

sdleihssirhc
sdleihssirhc

Reputation: 42496

You give both submit buttons the same name and then check its value in the postback with...

$_POST['submit_name']

Upvotes: 2

Related Questions