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.