How does thinkphp fail to get the file suffix when deleting a file? When you delete a file, the system prompts that the file failed to be deleted. at last, var_bump saw that the file did not contain a suffix. Address: http: // localhost/2015/thinkphp/blog/User/Database/index/Action/del/file/D20160105T144608-1. SQL is this, I use var_dump ($ _ GET) printed:
array(2) { ["Action"]=> string(3) "del" ["file"]=> string(18) "D20160105T144608-1"}{"success":0}
I want to get the file value. Baidu has not found the answer, which is really depressing.
Reply to discussion (solution)
This is the thing about TP. he Explained the suffix separately.
You can obtain it from $ _ SERVER ['path _ info'] or $ _ SERVER ['request _ URI '].
This is the thing about TP. he Explained the suffix separately.
You can obtain it from $ _ SERVER ['path _ info'] or $ _ SERVER ['request _ URI '].
The previous path_info can get the entire path, and the last request_url cannot get the suffix. I will customize a parameter after the file to automatically parse it. I really don't understand it.
U ('database/Index', array ('action' => 'del', 'file' => $ row, 'TT' => 1 )) the resolved path is:
Http: // localhost/2015/thinkphp/blog/User/Database/index/Action/del/file/D20160105T144608-1. SQL/tm/1 in this case you can get the correct value of file.
With another parameter,. SQL is not the suffix of the url.
Naturally, we can get rid of the misunderstanding of TP.