Jump to content

[SOLVED] unset()


The Little Guy

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.