Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如果表单已提交,则选中复选框_Php_Html - Fatal编程技术网

Php 如果表单已提交,则选中复选框

Php 如果表单已提交,则选中复选框,php,html,Php,Html,我想这样做,如果我的表格提交,然后复选框应选中 以下是我所拥有的: <input type="checkbox" id="chk" <?php if ($_POST['submit']){ echo checked } ?> /> 空白是因为您的php代码存在php错误,并且您已关闭了错误报告功能 if($\u POST['submit'])应该是if(isset($\u POST['submit']) echo-checked应echo“checked” 下面的示例适

我想这样做,如果我的表格提交,然后复选框应选中

以下是我所拥有的:

<input type="checkbox" id="chk" <?php if ($_POST['submit']){ echo checked } ?> />

空白是因为您的php代码存在php错误,并且您已关闭了
错误报告功能

  • if($\u POST['submit'])
    应该是
    if(isset($\u POST['submit'])

  • echo-checked
    echo“checked”

  • 下面的示例适合我

    <form id="form1" enctype="multipart/form-data" action="" method="post">
        //Stuff here
        <input name="submit" type="submit" value="Upload" />
    </form>
    <input type="checkbox" id="chk" <?php if (isset($_POST['submit'])){ echo 'checked'; } ?> />
    
    
    //这里的东西
    
    空白是因为您的php代码存在php错误,并且您已关闭了
    error\u reporting

  • if($\u POST['submit'])
    应该是
    if(isset($\u POST['submit'])

  • echo-checked
    echo“checked”

  • 下面的示例适合我

    <form id="form1" enctype="multipart/form-data" action="" method="post">
        //Stuff here
        <input name="submit" type="submit" value="Upload" />
    </form>
    <input type="checkbox" id="chk" <?php if (isset($_POST['submit'])){ echo 'checked'; } ?> />
    
    
    //这里的东西
    
    空白是因为您的php代码存在php错误,并且您已关闭了
    error\u reporting

  • if($\u POST['submit'])
    应该是
    if(isset($\u POST['submit'])

  • echo-checked
    echo“checked”

  • 下面的示例适合我

    <form id="form1" enctype="multipart/form-data" action="" method="post">
        //Stuff here
        <input name="submit" type="submit" value="Upload" />
    </form>
    <input type="checkbox" id="chk" <?php if (isset($_POST['submit'])){ echo 'checked'; } ?> />
    
    
    //这里的东西
    
    空白是因为您的php代码存在php错误,并且您已关闭了
    error\u reporting

  • if($\u POST['submit'])
    应该是
    if(isset($\u POST['submit'])

  • echo-checked
    echo“checked”

  • 下面的示例适合我

    <form id="form1" enctype="multipart/form-data" action="" method="post">
        //Stuff here
        <input name="submit" type="submit" value="Upload" />
    </form>
    <input type="checkbox" id="chk" <?php if (isset($_POST['submit'])){ echo 'checked'; } ?> />
    
    
    //这里的东西
    
    您的PHP代码中有一个错误。请更正它

     <input type="checkbox" id="chk" <?php if ($_POST['submit']){ echo 'checked'; } ?> />
    

    您的PHP代码中有一个错误。请更正它

     <input type="checkbox" id="chk" <?php if ($_POST['submit']){ echo 'checked'; } ?> />
    

    您的PHP代码中有一个错误。请更正它

     <input type="checkbox" id="chk" <?php if ($_POST['submit']){ echo 'checked'; } ?> />
    

    您的PHP代码中有一个错误。请更正它

     <input type="checkbox" id="chk" <?php if ($_POST['submit']){ echo 'checked'; } ?> />
    
    if(isset($\u POST['submit']))
    您的表单上是否有名为提交的输入?
    if(isset($\u POST['submit']))
    您的表单上是否有名为提交的输入?
    if(isset($\u POST['submit'])
    您的表单上是否有名为提交的输入?
    if(isset($\u POST['submit提交'))
    您的表单上是否有名为submit的输入?