PHP displays different content based on different URLs

Source: Internet
Author: User
PHP displays different content based on different URLs.
PHP displays different content based on different URLs.
I want to get a PHP file like browser browsing:
aa.php?type=1 Display content is 1
Aa.php?type=1&code1=1 Display content is 1-1
aa.php?type=1&code1=1&code2=2 Display content is 1-1-1
Aa.php?type=1&code1=1&code2=2&code3=3 Display content is 1-1-1-1

aa.php?type=2 Display content is 2
Aa.php?type=2&code1=1 Display content is 2-1
aa.php?type=2&code1=1&code2=2 Display content is 2-1-1
Aa.php?type=2&code1=1&code2=2&code3=3 Display content is 2-1-1-1

Just get a PHP file! Can you tell me something? The contents of each parameter display are not the same, and there is no association.
------Solution--------------------

if ($_get && $_get[' type ')} {
echo $_get[' type '];
for ($i =1; $i < count ($_get); $i + +) {
echo "-1";
}
}
?>


http://www.huaijiu176.com/aa.php?type=1 Display content is 1
Http://www.huaijiu176.com/aa.php?type=1&code1=1 Display content is 1-1
http://www.huaijiu176.com/aa.php?type=1&code1=1&code2=2 Display content is 1-1-1
Http://www.huaijiu176.com/aa.php?type=1&code1=1&code2=2&code3=3 Display content is 1-1-1-1

http://www.huaijiu176.com/aa.php?type=2 Display content is 2
Http://www.huaijiu176.com/aa.php?type=2&code1=1 Display content is 2-1
http://www.huaijiu176.com/aa.php?type=2&code1=1&code2=2 Display content is 2-1-1
Http://www.huaijiu176.com/aa.php?type=2&code1=1&code2=2&code3=3 Display content is 2-1-1-1

The upper address is a small demo can be opened directly to see ....
------Solution--------------------
Then there's no more technical content.

Direct 8 x If/elseif
------Solution--------------------
The #3 floor is inconsistent with what you said in the main post, and I don't know which one you want.
------Solution--------------------
Need to be clear what's the same as the product manager hates a will change one
------Solution--------------------
Send the Buddha to the West


if ($_get && $_get[' type ')} {
echo $_get[' type '];
for ($i =1; $i < count ($_get); $i + +) {
echo "-1";
}
}
echo "
These are the old results.
Here are the new requirements
";
if ($_get && $_get[' type '] = = 2 && $_get[' code1 '] = = 1 && $_get[' code2 '] = = 2 && $_get[' cod E3 '] = = 3) {
echo "My custom content 8";
}elseif ($_get && $_get[' type '] = = 2 && $_get[' code1 '] = = 1 && $_get[' code2 '] = = 2) {
echo "My Custom content 7";
}elseif ($_get && $_get[' type '] = = 2 && $_get[' code1 '] = = 1) {
echo "My custom content 6";
}elseif ($_get && $_get[' type '] = = 2) {
echo "My custom content 5";
}elseif ($_get && $_get[' type '] = = 1 && $_get[' code1 '] = = 1 && $_get[' code2 '] = = 2 && $_get [' code3 '] = = 3) {
echo "My custom content 4";
}elseif ($_get && $_get[' type '] = = 1 && $_get[' code1 '] = = 1 && $_get[' code2 '] = = 2) {
echo "My custom content 3";
}elseif ($_get && $_get[' type '] = = 1 && $_get[' code1 '] = = 1) {
echo "My Custom content 2";
}elseif ($_get && $_get[' type '] = = 1) {
echo "My custom content 1";
}
?>


The trick is to keep the possibility of not repeating the front line.
------Solution--------------------
Citation:
need to be clear how do you like the product Manager? One will change one
.

Ask the big coffee to help me to see the soapclient unsuccessful question Thank you
------Solution--------------------
Citation:
Ask the big coffee to help me see the problem of soapclient unsuccessful Thank you

SoapClient, you asked Mr. Xu to see what he should know.
  • Related Article

    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.