Write a small exercise. the directory structure is as follows: viewuseruserRegister. php sends a post request to serviceuseruserRegister. phpuserRegister. php file include_once. modelusermodel. phpuserModel. php file include_once m...
I wrote a small exercise. the directory structure is as follows:
/View/user/userRegister. php send
Post request to/service/user/userRegister. php
UserRegister. php file include_once
/Model/user/userModel. php
UserModel. php file include_once
/Model/db. php
The specific code contained is
Include_once '.../model/user/userModel. php' in userRegister. php'
-- "Include_once 'in userModel. php'.../db. php'
In eclipse, you can switch by pressing ctrl, but this error is still reported.
Reply content:
I wrote a small exercise. the directory structure is as follows:
/View/user/userRegister. php send
Post request to/service/user/userRegister. php
UserRegister. php file include_once
/Model/user/userModel. php
UserModel. php file include_once
/Model/db. php
The specific code contained is
Include_once '.../model/user/userModel. php' in userRegister. php'
-- "Include_once 'in userModel. php'.../db. php'
In eclipse, you can switch by pressing ctrl, but this error is still reported.
It looks messy. In fact, you can use index in the entry file. in php, define an app_dir variable that represents the root directory (for example, D: \ www \ Xproject). you can splice the app_dir variable every time you include the file. So as not to be so messy.
You can use magic variables to obtain app_dir.DIRTo obtain, of course, whether to intercept, and so on. you can just get the project root directory.
If you have said so much, you have not set the point. use absolute path. Thank you @ libraco.