聯(lián)系官方銷售客服
1835022288
028-61286886
在外部網(wǎng)站調(diào)用本站表單并提交數(shù)據(jù)給本站,這種情況下默認(rèn)是被迅睿cms攔截的,默認(rèn)環(huán)境下禁止外部提交數(shù)據(jù)到本站,這是安全因素
案例:本站的網(wǎng)站表單,打算放在其他網(wǎng)站上提交并收集數(shù)據(jù)
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、在表單管理預(yù)覽你的表單
3、在預(yù)覽界面查看頁面源代碼,并復(fù)制form的全部?jī)?nèi)容
把這里面的所有html復(fù)制出來,放在外部網(wǎng)站上,用來提交的
4、粘貼在外部網(wǎng)站,并設(shè)置域名
<!-- 系統(tǒng)關(guān)鍵js(所有自建模板必須引用) --> <script src="http://www.xunruicms網(wǎng)站的域名.com/config/language/zh-cn/lang.js" type="text/javascript"></script> <script src="http://www.xunruicms網(wǎng)站的域名.com/static/assets/global/plugins/jquery.min.js" type="text/javascript"></script> <script src="http://www.xunruicms網(wǎng)站的域名.com/static/assets/layer/layer.js" type="text/javascript"></script> <script src="http://www.xunruicms網(wǎng)站的域名.com/static/assets/js/cms.js" type="text/javascript"></script> <!-- 系統(tǒng)關(guān)鍵js結(jié)束 --> <script> document.domain = "www.xunruicms網(wǎng)站的域名.com"; </script>
5、關(guān)閉xunruicms后臺(tái)的,禁止跨站開關(guān)
6、關(guān)閉表單驗(yàn)證碼
就ok了