迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費且不限制商業(yè)使用,是免費開源的產(chǎn)品,以萬端互聯(lián)為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
在后臺新建了個網(wǎng)站表單,然后電腦版可以正常留言,但是手機版用電腦版的代碼提交留言時提示“系統(tǒng)錯誤”,
把表單提交地址改成手機版綁定的域名提示“跨站驗證禁止此操作”,
請問是什么原因,怎么解決?
有沒有在不修改表單提交地址和關閉后臺跨站驗證的情況下解決第一個那種問題呢?
地址給我看看
回復迅睿框架創(chuàng)始人
是本地環(huán)境,
電腦端代碼:<div id="submit" class="btn" onclick="dr_ajax_submit('http://localhost:88/index.php?s=form&c=zaixianyuyue&m=post', 'myform', '2000', 'index.php#yuyue')">立即預約</div>
移動端代碼:<div id="submit" class="btn" onclick="dr_ajax_submit('http://localhost:89/index.php?s=form&c=zaixianyuyue&m=post', 'myform', '2000', 'index.php#yuyue')">立即預約</div>
再咨詢個小白問題,如果源碼上傳到服務器上,電腦端域名是www.yuming.com,移動端域名是wap.yuming.com,到時候移動端再向電腦端提交信息算是跨站嗎?
域名不同就算跨域了,你這個域名是不同的。
你把整個form標簽體的代碼發(fā)了看看
回復迅??蚣軇?chuàng)始人
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
<input name="is_form" type="hidden" value="1">
<input name="is_admin" type="hidden" value="0">
<input name="is_tips" type="hidden" value="">
<input name="csrf_test_name" type="hidden" value="de343a2dc4e7b899cb347f9b132e21d2">
<div class="inputColumns clearfix">
<div class="column2" style="width:100%">
<div class="columnInner">
<input type="text" name="data[xingming]" id="dr_xingming" value="" placeholder="您的姓名 *">
</div>
<input type="text" name="data[dianhua]" id="dr_dianhua" value="" placeholder="您的電話 *">
<input type="text" name="data[weixin]" id="dr_weixin" value="" placeholder="您的微信 *">
<input type="text" class="form-control" name="code" style="width:57%" placeholder="請輸入驗證碼 *"><img align="absmiddle" style="cursor:pointer; height:37px; float:right;" onclick="this.src='/index.php?s=api&c=api&m=captcha&width=120&height=37&'+Math.random();" src="/index.php?s=api&c=api&m=captcha&width=120&height=37" />
<div id="submit" class="btn" onclick="dr_ajax_submit('http://localhost:89/index.php?s=form&c=zaixianyuyue&m=post', 'myform', '2000', 'index.php#yuyue')">立即預約</div>
</form>
看這個精簡的吧,上面那個太多了
沒有發(fā)現(xiàn)問題,整個頁面就一個form嗎
恩,就這一個form,現(xiàn)在的問題就是如果手機版調(diào)用電腦版的表單代碼點擊提交就顯示“系統(tǒng)錯誤”,如果把表單提交地址改成手機版綁定的域名然后把后臺的“跨站驗證”關了就可以正常留言。
那不應該會報錯,還是要把地址給我試一試
有沒有在不修改表單提交地址和關閉后臺跨站驗證的情況下解決第一個那種問題呢?
地址給我看看
回復迅睿框架創(chuàng)始人
是本地環(huán)境,
電腦端代碼:<div id="submit" class="btn" onclick="dr_ajax_submit('http://localhost:88/index.php?s=form&c=zaixianyuyue&m=post', 'myform', '2000', 'index.php#yuyue')">立即預約</div>
移動端代碼:<div id="submit" class="btn" onclick="dr_ajax_submit('http://localhost:89/index.php?s=form&c=zaixianyuyue&m=post', 'myform', '2000', 'index.php#yuyue')">立即預約</div>
回復迅睿框架創(chuàng)始人
再咨詢個小白問題,如果源碼上傳到服務器上,電腦端域名是www.yuming.com,移動端域名是wap.yuming.com,到時候移動端再向電腦端提交信息算是跨站嗎?
域名不同就算跨域了,你這個域名是不同的。
你把整個form標簽體的代碼發(fā)了看看
回復迅??蚣軇?chuàng)始人
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
<input name="is_form" type="hidden" value="1">
<input name="is_admin" type="hidden" value="0">
<input name="is_tips" type="hidden" value="">
<input name="csrf_test_name" type="hidden" value="de343a2dc4e7b899cb347f9b132e21d2">
<div class="inputColumns clearfix">
<div class="column2" style="width:100%">
<div class="columnInner">
<input type="text" name="data[xingming]" id="dr_xingming" value="" placeholder="您的姓名 *">
</div>
</div>
<div class="column2" style="width:100%">
<div class="columnInner">
<input type="text" name="data[dianhua]" id="dr_dianhua" value="" placeholder="您的電話 *">
</div>
</div>
<div class="column2" style="width:100%">
<div class="columnInner">
<input type="text" name="data[weixin]" id="dr_weixin" value="" placeholder="您的微信 *">
</div>
</div>
<div class="column2" style="width:100%">
<div class="columnInner">
<input type="text" class="form-control" name="code" style="width:57%" placeholder="請輸入驗證碼 *"><img align="absmiddle" style="cursor:pointer; height:37px; float:right;" onclick="this.src='/index.php?s=api&c=api&m=captcha&width=120&height=37&'+Math.random();" src="/index.php?s=api&c=api&m=captcha&width=120&height=37" />
</div>
</div>
</div>
<div id="submit" class="btn" onclick="dr_ajax_submit('http://localhost:89/index.php?s=form&c=zaixianyuyue&m=post', 'myform', '2000', 'index.php#yuyue')">立即預約</div>
</form>
回復迅??蚣軇?chuàng)始人
看這個精簡的吧,上面那個太多了
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
<input name="is_form" type="hidden" value="1">
<input name="is_admin" type="hidden" value="0">
<input name="is_tips" type="hidden" value="">
<input name="csrf_test_name" type="hidden" value="de343a2dc4e7b899cb347f9b132e21d2">
<input type="text" name="data[xingming]" id="dr_xingming" value="" placeholder="您的姓名 *">
<input type="text" name="data[dianhua]" id="dr_dianhua" value="" placeholder="您的電話 *">
<input type="text" name="data[weixin]" id="dr_weixin" value="" placeholder="您的微信 *">
<input type="text" class="form-control" name="code" style="width:57%" placeholder="請輸入驗證碼 *"><img align="absmiddle" style="cursor:pointer; height:37px; float:right;" onclick="this.src='/index.php?s=api&c=api&m=captcha&width=120&height=37&'+Math.random();" src="/index.php?s=api&c=api&m=captcha&width=120&height=37" />
<div id="submit" class="btn" onclick="dr_ajax_submit('http://localhost:89/index.php?s=form&c=zaixianyuyue&m=post', 'myform', '2000', 'index.php#yuyue')">立即預約</div>
</form>
沒有發(fā)現(xiàn)問題,整個頁面就一個form嗎
回復迅睿框架創(chuàng)始人
恩,就這一個form,現(xiàn)在的問題就是如果手機版調(diào)用電腦版的表單代碼點擊提交就顯示“系統(tǒng)錯誤”,如果把表單提交地址改成手機版綁定的域名然后把后臺的“跨站驗證”關了就可以正常留言。
那不應該會報錯,還是要把地址給我試一試