MVC schema PHP project, now to write an API for mobile phone application calls, how to invoke the portal file

Source: Internet
Author: User
MVC schema PHP project, now to write an API for mobile phone application calls, how to invoke the portal file
The login interface for the existing project should be called for the Mobile project, and the format for sending the request is ABC/AAA.PHP?CONTROLLER=BBB&ACTION=CCC
This kind of request, and the original project conflict, each visit has a landing limit, want to ask what the ladies have any way to solve the problem.
------Solution--------------------
If it is TP, it is done rewirte to index.php, using the only entry.
But seeing it rewrite the rules will know that a file or directory does not exist before it can be rewrite.
You should create an ABC folder in the same location as index.php.
Then copy the index.php into the ABC, of course, call the path of the lib you want to change the good.
Then/abc/index.php?controller=xxx&action=xxx access to it.

The final directory structure is
index.php
abc/index.php
http://localhost/index.php
Http://localhost/abc/index.php This address is used for mobile phone access.
------Solution--------------------
References:
Quote: References:

Dude, the MVC schema should all be accessed from the portal file.



Anyway, we're all like this:./INDEX.PHP?CONTROLLER=BBB&ACTION=CCC

When accessing a mobile phone, do you also invoke the login interface of the Web project?

Yes, because the controller is all routed through the routing! You are not directly accessible through the URL! So it's all accessed from the portal file! There are mobile phone access or PC access is actually the difference between the front end, PHP is the service side so basically no difference!
------Solution--------------------
With the user name and password, so that the permission to judge the time will be bypassed, but the action specific method, you have to special handling authentication permissions.
  • 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.