一些隐藏的 $_POST 变量无法在内部 iframe 中显示

Some of the hidden $_POST Vairables failing to display within internal iframe

我是编码新手,在过去的 12 个月里使用 S/O 学到了很多东西,所以我想说谢谢你帮助我,任何意见都非常感谢。

我创建了一个包含以下过程的 4 页注册表:
1. index.php(带有表单输入值的主页/着陆页) 2. page2.php(Select日期、时间并确认预约) 3. page3.php(预订确认请Select最近的位置,调查和服务) 4. 带有来自第 3 方的 iframe 插入的 SSL 支付页面

在 page3.php 我插入了一个托管在同一台服务器上的内部 iframe,使用单独的 css 文件、js 等。所以由于我缺乏编码技能,我找到了它插入 iframe 比将页面合并为 1 个完整页面更容易。

现在在所有页面上,我都设法获取了从页面 1 --> 2 --> 3 传递的 $_POST 变量 但是在第 3 页上,我无法在 iframe 隐藏输入中显示所有变量。我不明白为什么只有一些被显示而其他的没有。当表单被提交时,唯一通过的是你可以看到隐藏在源代码中的那些。

我也尝试过以下操作:

在页面顶部插入<?php session_start();?>

在页面底部我有:

<?php
        $_SESSION['Name']=$_POST['Name'];
        $_SESSION['Postcode']=$_POST['Postcode'];
        $_SESSION['Building']=$_POST['Building'];
        $_SESSION['EmailAddress']=$_POST['EmailAddress'];
        $_SESSION['Telephone']=$_POST['Telephone'];
        $_SESSION['datepicker']=$_POST['datepicker'];
        $_SESSION['timeofsurvey']=$_POST['timeofsurver'];
        $_SESSION['PropertyOwner']=$_POST['PropertyOwner'];
?>

我在每个页面上都有这些,以确保它们在每个页面上传递,所有输入 ['names'] 都是正确的,并且在 iframe 所在的同一页面上,它们显示给用户iframe 右侧的一个文本框,主要是为了向用户表明他们的信息在预约时是正确的。

这是我的 iframe 表单源代码:

<div id="app" my-app my-controller="Controller">
    <form action="Processing.php" id="regForm" name="regForm" method="post">
    <input type="hidden" value="<?php echo $_SESSION['Name'];?>" name="Full Name">
    <input type="hidden" value="<?php echo $_SESSION['Telephone'];?>" name="Telephone">
    <input type="hidden" value="<?php echo $_SESSION['EmailAddress'];?>" name="Email">
    <input type="hidden" value="<?php echo $_SESSION['Building'];?> " name="Building Number or Name">
    <input type="hidden" value="<?php echo $_SESSION['Postcode'];?>" name="Postcode">
    <input type="hidden" value="<?php echo $_SESSION['PropertyOwner'];?>" name="PropertyOwner">    
    <input type="hidden" value="<?php echo $_POST['datepicker'];?>" name="Survey Date">
    <input type="hidden" value="<?php echo $_POST['timeofsurvey'];?>" name="Survey Time"> 

唯一无法显示的隐藏变量如下:

['Name']
['EmailAddress']
['datepicker']
['timeofsurvey']

所有其他变量都显示正常,正如我所说,即使插入了 iframe 的页面也正确地向用户显示所有变量。如果你点击查看页面源代码,你会看到它们很好......然后一旦你查看内部 iframe 源代码,你就会发现上面的变量丢失了。

这是查看 iframe 源代码时的结果:

<div id="app" my-app my-controller="Controller">
<form action="Processing.php" id="regForm" name="regForm" method="post">
<input type="hidden" value="" name="Full Name">       **<----- This input is missing**
<input type="hidden" value="0123456789" name="Telephone">
<input type="hidden" value="" name="Email">       **<------- This input is missing**
<input type="hidden" value=" " name="Building Number or Name">
<input type="hidden" value="NW1 1AA" name="Postcode">
<input type="hidden" value="Yes" name="PropertyOwner">    
<input type="hidden" value="" name="Survey Date">       **<--- This input is missing**
<input type="hidden" value="" name="Survey Time">       **<--- This input is missing**
<input type="hidden" name="field_passthrough1" value="Consumer" />
<input type="hidden" name="field_passthrough2" value="en-UK" />

我希望我没有在这里绕过最长的路来试图解释,因为我知道你们中的很多人真的很忙于阅读像我这样的长篇文章,而事情会如此简单..我有花了 2 天时间尝试各种方法来让它工作,但我似乎无法解决这个问题。

非常感谢大家的帮助,谢谢。

############# LAMONDE 更新################

这就是我现在拥有 iframe 的方式,现在唯一缺少的字段是:

['Name']
['EmailAddress']
['Building']

---> ['datepicker'] 和 ['timeofsurvey'] 正在工作...

<input type="hidden" value="<?php echo $_SESSION['Name'];?>" name="Name">
<input type="hidden" value="<?php echo $_SESSION['Telephone'];?>" name="Telephone">
<input type="hidden" value="<?php echo $_SESSION['EmailAddress'];?>" name="EmailAddress">
<input type="hidden" value="<?php echo $_SESSION['Building'];?> " name="Building">
<input type="hidden" value="<?php echo $_SESSION['Postcode'];?>" name="Postcode">
<input type="hidden" value="<?php echo $_SESSION['PropertyOwner'];?>" name="PropertyOwner">    
<input type="hidden" value="<?php echo $_SESSION['datepicker'];?>" name="datepicker">
<input type="hidden" value="<?php echo $_SESSION['timeofsurvey'];?>" name="timeofsurvey">  

这是 page3.php iframe 上的源代码视图:

<input type="hidden" value="" name="Name">
<input type="hidden" value="07541258585" name="Telephone">
<input type="hidden" value="" name="EmailAddress">
<input type="hidden" value=" " name="Building">
<input type="hidden" value="saas" name="Postcode">
<input type="hidden" value="No" name="PropertyOwner">    
<input type="hidden" value="21/01/2015" name="datepicker">
<input type="hidden" value="4:30 pm" name="timeofsurvey">  

您的 $_POST 将与您输入的名称相同。

所以:$_POST['Name'] != $_POST['Full Name'];

每一个缺失的输入都几乎相同。

此外,您真的不应该在输入名称中使用空格