1

我有一个 I 声明;

if($game_set->issue_challenge()){echo "test";}else {"test failed";}

我有一个按钮:

<input type="submit" name="submit" id="submit" value="Submit" />

我想能够说:if the button isset, then $values = $_POST['gamelist'] and if($game_set->issue_challenge()){echo "test";}else {"test failed";}

我在想类似的东西

if (isset($_POST['Submit'])) {
$values = $_POST['gamelist']
if($game_set->issue_challenge()){echo "test";}else {"test failed";}
}

有任何想法吗?

谢谢

4

1 回答 1

1

假设您使用的是 POST 表单:

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (isset($_POST['submit']) && ($_POST['submit'] == 'Submit')) {
       ... it was clicked
    }
}
于 2011-05-09T20:34:48.453 回答