将 POST 数据传递给两个 php 文件 [英] Pass POST data to two php files

查看:26
本文介绍了将 POST 数据传递给两个 php 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我希望这将是一个简单的解决方案.

Hello I'm hoping this will be an easy fix.

简单地说,我想做以下事情:

To simply put it, I want to do the following:

1)有一个用户输入数据(estimate.html)并提交到validate.php的表单

1) Have a form that users input data (estimate.html) and submit to validate.php

2) 从validate.php 检查POST 数据,如果一切正常,用户按下提交按钮,然后将相同的POST 数据发送到submission.php.

2) From validate.php, check the POST data and if everything is ok, the user presses the submit button which then sends the same exact POST data to submission.php.

有没有什么简单的方法可以在我的两个 php 文件中从原始表单发送完全相同的 POST 数据?(希望没有会议)

Is there any easy way to send the same exact POST data from the original form throughout my two php files? (Hopefully without sessions)

estimate.html -> validate.php -> submission.php

<小时>

我现在拥有的:


What I have right now:

我有一个表单,它可以包含未知数量的字段,这些字段可以传递到validate.php.

I have a form that can have an unknown amount of fields that can be passed into validate.php.

我已经验证了发送到 validate.php 的 POST 数据中的所有条目.如果所有数据都验证成功,那么与其将所有数据插入隐藏字段并将数据重新提交到 submit.php,我可以重新发送发送 validate.php 的 POST 吗?

I have already validated all the entries in the POST data sent to validate.php. If all data validates successfully, then rather than inserting all data into hidden fields and resubmitting the data to submission.php, can I just resend the POST that was sent validate.php?

推荐答案

是的!使用仅会话或隐藏字段.我猜..

Yes! Using session only or hidden fields. I guess..

你也可以在 hidden 中使用数组来减少元素的大小.

You can also use array in hidden to reduce the size of elements.

<input type="hidden" value="array('username'=>'user','password'=>'password');">

类似的东西.

这篇关于将 POST 数据传递给两个 php 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆