A get question

Source: Internet
Author: User
A get question. what is my idea about this program?

Add the get parameter when the program is normally accessed to execute the get result.

Such as xxx. php? Login

This type
The code is as follows:
echo "index";if ($_GET['login']){echo "login" ;}


It seems that there is no problem, but even if login is written into the url, the submitted value is still null.
Then, the if statement is still not executed.
In other words, I change if to if ($ _ GET ['login'] = "x ")

Url access? Login is executed.

I cannot understand it. if no operator is added, if is used to judge whether it is null.
Added the value assignment .. (amount, here is the value assignment)


Okay, but I guess xxx. php? Login

What should I do if the specified content is returned?


Reply to discussion (solution)

if (isset($_GET['login'])){    echo "login" ;}

If ($ _ GET ){
Echo key ($ _ GET );
}

echo "index";if (isset($_GET['login'])){    echo "login" ;}

If ($ _ GET ['login'] = "x") can be written successfully, because = is a value assignment operation, which determines whether the value assignment is successful, use = to determine whether the value is equal to or not.

If ($ _ GET ['login'] = "x") can be written successfully, because = is a value assignment operation, which determines whether the value assignment is successful, use = to determine whether the value is equal to or not.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.