php 如何将 if 语句附加到按钮?
我有一个我的声明;
if($game_set->issue_challenge()){echo "test";}else {"test failed";}
我有一个按钮:
<input type="submit" name="submit" id="submit" value="Submit" />
我希望能够说:如果按钮设置,则 $values = $_POST['gamelist'] 和 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";}
}
想法?
谢谢
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 "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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您使用的是 POST 表单:
Assuming you're on a POST form: