小编Aks*_*man的帖子

如果未选中复选框,则出现"未定义的索引"错误

当我选中复选框时没有错误,但是当我没有选中复选框时它会给我错误.

 <?php
    if(isset($_REQUEST['btn']))
    {
        $remmber = $_REQUEST['active'];
    if($remmber == "on")
        {  
            echo "Checked";
        }
        else  {$remmber = "";}
    }
    ?>
    <html>
    <form name= "frm" action = "test.php" method = "post" >
    <p>Username
    <input  type = "text" name = "name" value = ""  />
    </p>

    <p>Password
    <input type = "text" name = "password" value = "" />
    </p>

    <p>
    <td colspan = "2"><input type = "checkbox" name = "active" value = "active" />Keep Me Loged In 
    </p>

    <p><input type = "submit" …
Run Code Online (Sandbox Code Playgroud)

php

2
推荐指数
1
解决办法
2960
查看次数

标签 统计

php ×1