非法字符串偏移和未初始化字符串

时间:2015-09-18 22:08:11

标签: php

我已经编写了下面的代码,但我不明白为什么会出现这些错误。

我基本上想要实现的是此代码检查表单是否已填充,如果没有,则会输出错误。奇怪的是,它适用于第一个,($name['name']),但在那之后,它将无法工作..

    <?php 
    $name = "";
    $username = "";
    $password = ""; 

    $name = $_POST['name'];
    $username = $_POST['username'];
    $password = $_POST['password'];

    if(isset ($name['name']) || ($username['username']) || ($password['password'])) {
        echo "Hurray, user was created!";
    } else {
        echo "Looks like something isn't filled out, try again!";
    }
?>

0 个答案:

没有答案