On the first day, PHP crashed. all the errors were reported ??? If ($ _ GET [all] yes) {& nbsp; echo & nbsp; hi; & nbsp;} error: Notice: & nbsp; Undefined & nbsp; index: & nbsp; all & nbsp; in & nbsp; C ???
if($_GET['all']=='yes')
{
echo "hi";
}
Error: Notice: Undefined index: all in C: \ Users \ Administrator \ Downloads \ PHPnow-1.5.6.4237493736 \ htdocs \ oa \ manage. php on line 71
The younger brother is confused about the difference between an equal sign and an equal sign.
In addition, if it is changed to an equal sign, there is no error, but this statement is useless. there will be hi if all = yes is displayed on the url, and there will still be hi if there is no all = yes on the url.
------ Solution --------------------
If (isset ($ _ GET ['all']) & $ _ GET ['all'] = 'yes ')
{
Echo "hi ";
}
------ Solution --------------------
$ _ GET ['all'] is not defined. it is not an error, but a prompt.
You can use the isset () method to determine whether the value has been defined and then set the value.
For example:
if(isset($_GET['all']) && $_GET['all']=='yes')
{
echo "hi";
}
------ Solution --------------------
An equal sign is a value assignment.
The two equal signs are equal
You should first use isset to determine the correct method.