简体   繁体   English

将POST数据传送到另一页

[英]Carry POST data to another page

I have a php form that at the moment posts the data to a Paypal cart, but I want to post the data to a new php page almost like a confirmation page which shows the options and selections you selected to and from that point for you to be able to send on to Paypal? 我有一个php表格,此刻将数据发布到Paypal购物车,但我想将数据发布到新的php页面,就像确认页面一样,该页面显示了您选择的选项和选择。可以发送到贝宝吗?

Is this possible? 这可能吗?

Someone new to session or post may find this example helpful. 会话或发布的新手可能会发现此示例很有帮助。 complete example of what you want. 您想要的完整示例。 how to Store and view post array into a session named POSTDATA.post or anyother variables are accessible to a same session, from any page if its stored in a session variable. 如何将帖子数组存储和查看到名为POSTDATA.post的会话中,或者同一会话可以从任何页面访问(如果其存储在会话变量中)。

form.php form.php

<?php
//PHP content of form.php file
session_start();
if ($_POST)
{
    $_SESSION['POSTDATA']=$_POST;
}
?>
<html>
<head></head>
<body>
  <form action="form.php" method="post">
    <input type="text" name="hello"/>
    <input type="submit" name="submit" value="submit"/>
  </form>
  <!--<a href="anotherpage.php">link to some another page for testing</a>-->
</body>
</html>

anotherpage.php anotherpage.php

<?php
session_start();
echo "This is some another page somewhere inside.ANOTHER PAGE SAYS";
echo '<pre>';
print_r($_SESSION['POSTDATA']);
echo '<pre>';
echo "INPUT BOX VALUE ".$_SESSION['POSTDATA']['hello'].'<br/>';
echo "SUBMIT BUTTON VALUE ".$_SESSION['POSTDATA']['submit'];
?>

一种可能性是将发布数据存储在$ _session ['post'] = $ _POST中,以持久存储并使用$ _session ['post'] ['field']在新页面上获取发布数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM