我有一份声明;
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";}
}
任何想法?
感谢
答案 0 :(得分:1)
假设您正在使用POST表单:
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['submit']) && ($_POST['submit'] == 'Submit')) {
... it was clicked
}
}