建立一个足球游戏的网站以获得有趣的会员功能已经完成并且主页面存在问题,坦率地说我对如何执行此页面感到茫然。
该页面是一个选择屏幕,这是我的想法,您从下拉选择选项列表中选择一个团队并将其发送到数据库(mySQL),以便管理员可以跟踪。问题是,我需要一些限制,你什么时候可以选择;根据球队的比赛时间,选择屏幕会被禁用某些时间和天数,如果球队在周四晚上8点比赛,那么我只需要在比赛前1小时禁用选择列表,直到下周。
我不确定自己是否朝着正确的方向前进,或者我是否已经离开了,所以我们非常欣赏清晰度,开放使用Javascript或PHP,最简单的方法是为我的目的提供全部功能。< / p>
<form action="login_success.php" method="POST">
<fieldset>
<legend>Pick</legend>
<select id="tm1" name="teams">
<option value="wr">Washington Redskins</option>
<option value="nyg">New York Giants</option>
<option value="pe">Philadelphia Eagles</option>
<option value="dc">Dallas Cowboys</option>
<option value="br">Baltimore Ravens</option>
<option value="ps">Pittsburgh Steelers</option>
<option value="tt">Tennessee Titans</option>
<option value="gbp">Green Bay Packers</option>
<option value="ss">Seattle Seahawks</option>
<option value="cbr">Cleveland Browns</option>
<option value="bb">Buffalo Bills</option>
<option value="jj">Jacksonville Jaguars</option>
<option value="ic">Indianapolis Colts</option>
<option value="ht">Houston Texans</option>
<option value="kcc">Kansas City Chiefs</option>
<option value="md">Miami Dolphins</option>
<option value="nep">New England Patriots</option>
<option value="nyj">New York Jets</option>
<option value="slr">Saint Louis Rams</option>
<option value="nos">New Orleans Saints</option>
<option value="mv">Minnesota Vikings</option>
<option value="tbb">Tampa Bay Buccaneers</option>
<option value="ac">Arizona Cardinals</option>
<option value="af">Atlanta Falcons</option>
<option value="sf49">San Francisco 49ers</option>
<option value="sdc">San Diego Chargers</option>
<option value="or">Oakland Raiders</option>
<option value="db">Denver Broncos</option>
<option value="cbe">Cincinnati Bengals</option>
<option value="cp">Carolina Panthers</option>
<option value="dl">Detroit Lions</option>
<option value="cbea">Chicago Bears</option>
</select>
<br>
<input type="submit" value="submit">
</fieldset>
</form>
<?php
//If statement to control pick selection "disabled/enabled"
if(strtotime("Today") == strtotime("Thursday") || strtotime("Friday") || strtotime("Saturday") || strtotime("Sunday") || strtotime("Monday")) {
echo '<h2 style = "text-align: center">Make a selection! Pick(s) are now available</h2>';
$pick = $_POST['teams'];
$picked = isset($_POST['teams']);
if($picked) {
echo '<br><p style = "text-align: center">You have made a selection, feel free to change your pick until ONE HOUR before game time.<p><br>';
}
}
?>