0
我嘗試從我的後端跨越ajax重新使用代碼,使用OOP模式和受保護的女巫htaccess編寫。我的問題是,當要求頁面時,我想避免前端用戶的身份驗證彈出窗口。允許php訪問htacess保護代碼
藥結構
-admin
-controllers
--oneofmycontroller.php
-models
--oneofmymodel.php
-views
-index.php
-.htaccess
-fontend
-myphpfiles
method.php// and here I try to access one of my controller to fetch datas
和我怎樣嘗試訪問
like /admin?controller=oneofmycontroller&action=methodToCall
方式的前端程序尚未OOP兼容
方案
vistor->access public page->public page calls back-end script across ajax to fetch data(which is htacess protected) -> if visitor is not logged-in sees a pop-up (and this one I would like to avoid but on the same time keep my back-end safe)
您已經登錄後端(通過HTTP身份驗證),客戶端通過AJAX向控制器發送進一步的請求......這是您的情況嗎? – bitfox