trollolodn icon

#php #restful 9lessions problems

trollolodn | PRO | 03/10/13 03:25:00 AM UTC | 0 ⭐ | 106 👁️ | Never ⏰ | []
PHP |

490 B

|

None

|

0 👍

/

0 👎

//file api.php
 
$func = strtolower(trim(str_replace("/","",$_REQUEST['rquest'])));
 
//sửa thành
 
- $func = strtolower(trim(str_replace("/ws/","",$_SERVER['REQUEST_URI'])));
 
 
.htaccess
 
                RewriteRule ^(.*)$ api.php?rquest=$1 [QSA,NC,L]
 
//thành
 
                RewriteRule ^(.*)$ api.php?$1 [QSA,NC,L]
 
//Lưu ý là api phải nằm trong thư mục ws, nếu change thì thay thu muc
 
$func = strtolower(trim(str_replace("/<thu muc>/","",$_SERVER['REQUEST_URI'])));

Comments