A question about get

Source: Internet
Author: User
My idea of this program is

When the program is in normal access, add the get parameter so that it executes the result after get

such as Xxx.php?login

This type
The code is as follows
echo "Index"; if ($_get[' login ') {echo "Login";}


There seems to be no problem, but login is still null even if it is written into the URL
So, if this is still not done
In other words, I will change if to if ($_get[' login ') = "x")

URL Access? login it was executed.

I'm a little confused. If you do not add an operator, if just to determine whether it is empty
Add the assignment value. (Well, here is the assignment)


All right, but I think, xxx.php?login.

Return the specified content, what should I do?


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") This must be successful, because = is an assignment operation, this sentence is to determine whether the assignment is successful, the judgment is equal to should be used = =.

if ($_get[' login '] = "x") This must be successful, because = is an assignment operation, this sentence is to determine whether the assignment is successful, the judgment is equal to should be used = =.

  • 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.