trollolodn

#php #restful 9lessions problems

Mar 9th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. //file api.php
  2.  
  3. $func = strtolower(trim(str_replace("/","",$_REQUEST['rquest'])));
  4.  
  5. //sửa thành
  6.  
  7. - $func = strtolower(trim(str_replace("/ws/","",$_SERVER['REQUEST_URI'])));
  8.  
  9.  
  10. .htaccess
  11.  
  12.                 RewriteRule ^(.*)$ api.php?rquest=$1 [QSA,NC,L]
  13.  
  14. //thành
  15.  
  16.                 RewriteRule ^(.*)$ api.php?$1 [QSA,NC,L]
  17.  
  18. //Lưu ý là api phải nằm trong thư mục ws, nếu change thì thay thu muc
  19.  
  20. $func = strtolower(trim(str_replace("/<thu muc>/","",$_SERVER['REQUEST_URI'])));
Advertisement
Add Comment
Please, Sign In to add comment