Questions about php game index

Source: Internet
Author: User
The following problems occur when using php to index games. Games can be divided into the following types by region: mainland China, Hong Kong, Taiwan, Europe, Korea, and Japan & nbsp; by screen: 3D2. 5D2D & nbsp; by type: Role-playing FPS shooting music horizontal panel to achieve the effect: After selecting 'Hong Kong and Taiwan ', the selected condition is: Hong Kong and Taiwan. The current URL is www.aaa.com.
I encountered the following problems when using PHP to index games.


Games can be divided into the following types:


By region: mainland China, Hong Kong, Taiwan, Europe, America, and Korea

By Image: 3D 2.5D 2D

By type: role playing FPS shooting music horizontal combat

The expected result is:

After selecting, the "Hong Kong and Taiwan" option is selected as "Hong Kong and Taiwan. The current URL is www.aaa.com/game.php? Id = 3 & area = g
Continue to select. after selecting '3D ', the selected condition is: Port + 3D. the current URL is www.aaa.com/game.php? Id = 3 & area = g & pic = 3d
Continue to select, and then select 'assumer'. at this time, the selected condition is: Hong Kong and Taiwan + 3D + the current URL for assuming the role is www.aaa.com/game.php? Id = 3 & area = g & pic = 3d & type = role



How can this effect be achieved? How can the current URL be implemented as mentioned above.

------ Solution --------------------
You have used js or php.

Php:
When generating html, the url of the option is: $ _ SERVER [HOST] ......? . Implode ($ _ GET, array (key => value of the current option ))

Js:
Similarly, you only need to use js to process URLs.
------ Solution --------------------
To put it simply, the key = value of the current option is added to the end of the current url.
There is just a trick. when the key is the same, we need to overwrite it, instead of directly adding it to the back.
------ Solution --------------------
Click here to submit the data to the server and process the returned data to the specified url. Similar to 58 local processing.
It is mainly a set of url strings. Request. the response is the specified url. If you have selected all of them here. Three interactions
Js cannot change the browser address.
------ Solution --------------------
Use parse_str (array mode) and http_build_query ()

Discussion

Reference:
To put it simply, the key = value of the current option is added to the end of the current url.
There is just a trick. when the key is the same, we need to overwrite it, instead of directly adding it to the back.



This tips cannot be implemented ..

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.