Home Backend Development PHP Tutorial js客户端php之有关问题有点难

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

Jun 13, 2016 pm 01:37 PM
php script wc window

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(插入到数据库中);

Copy after login


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

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

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

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

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

-->exit
Copy after login


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

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

这个时候再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 的限制
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

CakePHP Date and Time

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

CakePHP Project Configuration

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

CakePHP File upload

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

CakePHP Routing

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

Discuss CakePHP

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP Quick Guide

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

How To Set Up Visual Studio Code (VS Code) for PHP Development

See all articles