聯系官方銷售客服
1835022288
028-61286886
在外部網站調用本站表單并提交數據給本站,這種情況下默認是被迅睿cms攔截的,默認環境下禁止外部提交數據到本站,這是安全因素
案例:本站的網站表單,打算放在其他網站上提交并收集數據
1、更改xunruicms的index.php,增加下面一句:
header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE"); header('Access-Control-Allow-Headers:x-requested-with,content-type');
2、在表單管理預覽你的表單
3、在預覽界面查看頁面源代碼,并復制form的全部內容
把這里面的所有html復制出來,放在外部網站上,用來提交的
4、粘貼在外部網站,并設置域名
<!-- 系統關鍵js(所有自建模板必須引用) --> <script src="http://www.xunruicms網站的域名.com/config/language/zh-cn/lang.js" type="text/javascript"></script> <script src="http://www.xunruicms網站的域名.com/static/assets/global/plugins/jquery.min.js" type="text/javascript"></script> <script src="http://www.xunruicms網站的域名.com/static/assets/layer/layer.js" type="text/javascript"></script> <script src="http://www.xunruicms網站的域名.com/static/assets/js/cms.js" type="text/javascript"></script> <!-- 系統關鍵js結束 --> <script> document.domain = "www.xunruicms網站的域名.com"; </script>
5、關閉xunruicms后臺的,禁止跨站開關
6、關閉表單驗證碼
就ok了