Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何通过 php 代码获取复选框(标记或未标记)的结果?
<input type="checkbox" name="new" style="float:right" />
if(isset($_POST['new'])){ }
会告诉你是否检查过。如果您还希望能够检查该值,则需要为输入提供一个值。
<input type="checkbox" name="new" value="someval" style="float:right" /> <?php if(isset($_POST['new']) && $_POST['new'] == 'someval'){ }