Rumah  >  Artikel  >  pembangunan bahagian belakang  >  js客户端php之有关问题有点难

js客户端php之有关问题有点难

WBOY
WBOYasal
2016-06-13 13:37:461184semak imbas

js客户端php之问题有点难

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
wc();//是一个数据插入自定义函数
echo "<script>if(confirm('程序解析的数据正确吗?确定将插入到数据库中,有误请取消本次操作,重新编辑excel文件.')){}else{window.history.go(-1);}</script>";//如果确定则执行wc()函数;如果取消则后退至前一页面,不wc() 函数。
wc(插入到数据库中);



我的代码的语句要如何修改?
类似这样的
JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->return confirm('确定提交吗?/Are you sure?');

能不能执行一个
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->exit


------解决方案--------------------
正确流程是

首先客户端提交数据的时候就弹出提示说是否确认

这个时候再form提交给服务器

服务器直接把数据入库。

------解决方案--------------------
<script><br />if(confirm('程序解析的数据正确吗?确定将插入到数据库中,有误请取消本次操作,重新编辑excel文件.')) {<br /> window.location = 'wc.php';<br />}else{<br /> window.history.go(-1);<br />}<br /></script>

在 wc.php 中执行 wc() 函数
------解决方案--------------------
那是因为你的表单数据超出了 post_max_size 的限制
Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn