I have a I statement;
if($game_set->issue_challenge()){echo "test";}else {"test failed";}
and I have a button:
<input type="submit" name="submit" id="submit" value="Submit" />
I want to be able to say: if the button isset, then $values = $_POST['gamelist'] and if($game_set->issue_challenge()){echo开发者_JAVA百科 "test";}else {"test failed";}
I was thinking something like
if (isset($_POST['Submit'])) {
$values = $_POST['gamelist']
if($game_set->issue_challenge()){echo "test";}else {"test failed";}
}
any ideas?
thanks
Assuming you're on a POST form:
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['submit']) && ($_POST['submit'] == 'Submit')) {
... it was clicked
}
}
精彩评论