Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 某些隐藏的$u POST VARABLE无法在内部iframe中显示_Php_Variables_Post_Iframe_Session Variables - Fatal编程技术网

Php 某些隐藏的$u POST VARABLE无法在内部iframe中显示

Php 某些隐藏的$u POST VARABLE无法在内部iframe中显示,php,variables,post,iframe,session-variables,Php,Variables,Post,Iframe,Session Variables,我对编码是新手,在过去的12个月里通过S/O学到了很多东西,所以我想感谢您对我的帮助,我们非常感谢您的帮助 我创建了一份4页的注册表,其中包括以下流程: 1.带有表单输入值的index.php主页/登录页 2.page2.php选择日期、时间和确认约会 3.page3.php预订确认请选择最近的位置、调查和服务 4.第三方插入iframe的SSL支付页面 在page3.php上,我插入了一个内部iframe,它使用单独的css文件js等托管在同一台服务器上。。因此,由于我缺乏编码技能,我发现插入

我对编码是新手,在过去的12个月里通过S/O学到了很多东西,所以我想感谢您对我的帮助,我们非常感谢您的帮助

我创建了一份4页的注册表,其中包括以下流程: 1.带有表单输入值的index.php主页/登录页 2.page2.php选择日期、时间和确认约会 3.page3.php预订确认请选择最近的位置、调查和服务 4.第三方插入iframe的SSL支付页面

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

现在,在所有页面上,我都设法获得从第1->2->3页传递的$u POST变量 但是在第3页,我没有得到iframe隐藏输入中显示的所有变量。我不明白为什么只有一些在展出,而另一些没有。。当表单被提交时,只有在源代码中可以看到隐藏的表单

我还尝试做了以下工作:

在页面顶部插入

在这一页的底部,我有:

<?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'];
?>
所有其他变量都显示得很好,正如我所说的,即使插入了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"> 
<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" />
-->['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">  

您的$\u帖子将与您的输入同名

所以:$_POST['Name']!=$_职位[‘全名’]

对于丢失的每一个输入都几乎相同


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

我看到了你的整个帖子,我的答案是正确的。您正在将$\u POST['Name']设置为$\u SESSION['Name'],但是$\u POST['Name']不存在,因为index.php上的输入名称是:“全名”而不是“名称”。原始输入变量是:对于EmailAddress和Building,这也是正确的。所有其他页面的代码都与我上面发布的代码完全相同,并且除iframe外,所有页面都显示隐藏的变量。iframe被插入到page3.php中,用户可以在其中查看他已经插入的内容,例如,这里是page3.php返回给用户的代码…Name:Building Name/Number:Email:在iframe中,输入的名称是全名,因此,当您发布它时,您的$_SESSION['Name']将被清空,因为您隐藏的输入名称是:全名而非名称,所以当它来自iframe时,$_POST['Name']==NULL。将page2.php中的名称更改为与page3输入匹配,如您所说:Name=建筑编号或名称应与$_SESSION['Name']相同;更改名称=全名改为姓名,电子邮件改为电子邮件地址,建筑物名称或编号改为建筑物,现在从第1页到第3页,包括iframe,一切都正常运行。。谢谢你的帮助,我真的很感激:
<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">  
<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">