My website wants to be made into two homepages, but I don't know how to record the user's choice!

Source: Internet
Author: User
My website wants to be made into two homepages, but I don't know how to record the user's choice! There are two problems:
1. how to access these two home pages, the address bar shows only the domain name, that is, it seems to be the root directory.
2. if you want to record which homepage the user accesses, you can still enter the homepage the next time you visit it.


Reply to discussion (solution)

1. you can include the program on the target page on the entry page, or use the framework.
2. logs can be recorded in cookies or in user tables.

Can anyone help me?

2l is not a solution already provided.

You can record it in a data table as a field.
After each login, read and then automatically load the home page.
If you have logged on, you can identify it in cookies.

Record it in cookies.

Oh ··
2nd questions have been fixed, but I don't know how to solve the 1st questions?

If nginx is used for configuration, it is much more convenient. you can set the root address based on the access IP address source.

You can use two different templates for the two home pages.

Similarly, index. php can determine the user to select and then read different templates.

For example

if($userStyle = "default"){  include_once("template/default/index.html");}else{  include_once("template/other/index.html");}

You can use two different templates for the two home pages.

Similarly, index. php can determine the user to select and then read different templates.

For example
PHP code? 12345if ($ userStyle = "default") {include_once ("template/default/index.html");} else {include_once ("template/othe ......

$ UserStyle = "default"
I can't edit it because I have missed the equal sign and added it. I'm depressed.

If you log on to the database and select which page to access, you can write it to the database.
If the user chooses the page, it seems that the cookie, session, or IP address can only be used to determine
If you change the machine, you cannot control it.

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.