Jump to content

Recommended Posts

I am submitting a registration form... but... I think I have a better Idea, I think I could just change the value of submit, and match against the value

 

Still, the question remains: why are you testing against submit?  Is it the actual form submission button?  Or have you named another form input 'submit'?  If it's the former, I can't think of a reason why you'd need to unset it.

Link to comment
https://forums.phpfreaks.com/topic/100352-solved-unset/#findComment-513133
Share on other sites

I am submitting a registration form... but... I think I have a better Idea, I think I could just change the value of submit, and match against the value

I am curious now, are you going to have multiple submit buttons with different values?

If so:

<?php
//The test for submit
if(isset($_POST['submit'])) {
    $command = trim($_POST['submit']);

     if ($command == "Submit"){
        //Do something
     }
     if ($command == "Cancel"){
        //Do something else
     }
     if ($command == "Edit"){
        //Do something else
     }
}
//This will allow you to "see" which button was pressed.
?>

Link to comment
https://forums.phpfreaks.com/topic/100352-solved-unset/#findComment-513160
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.