Hello everyone,
I have finished reading several posts and threads on urlencode/decode and I am still at a loss. Yet I believe that this is the only method that I can use to do what I need to accomplish.
Over view of what I am attempting to do...
I have a page that is simply a form that collects name, address etc. from this it gets posted to another page and converted into $_SESSION information. Simple enough.
This page that is being posted to also loads an iFrame that is coming from a different domain. The information in the $_SESSION vars, I need to pass to this iFrame page.
Example:
<!-- Note only using hidden as I didn't want to build the form at test phase-->
<form name="test" method="post" action="iframe_test.php">
<input type="submit" name="Submit" />
<input type="hidden" name="fName" value="abc" />
<input type="hidden" name="lName" value="def" />
<input type="hidden" name="address1" value="ghi" />
<input type="hidden" name="address2" value="jkl" />
<input type="hidden" name="country" value="mno" />
<input type="hidden" name="postal_code" value="pqr" />
<input type="hidden" name="city" value="stu" />
<input type="hidden" name="retUrl" value="vwx">
<input type="hidden" name="decUrl" value="yz">
So from here I am hitting the iframe_test.php and doing the following:
function StripSpecChar($val) {
return (preg_replace('/[^a-zA-Z0-9" "-.@\:\/_]/','', $val));
}
foreach ($_POST as $key => $val) {
$_SESSION[$key] = StripSpecChar($val);
}
and I get a session array that looks like this:
Array
(
[fName] => abc
[lName] => def
[address1] => ghi
[address2] => jkl
[country] => mno
[postal_code] => pqr
[city] => stu
[retUrl] => vwx
[decUrl] => yz
)
Still all good so far....call the iFrame
<body>
Some page stuff here
<div align="center"><span class="style1"><strong>This is the iFrame Page</strong></span>
</div>
<div align="center">
<iframe src="http://www.other_domain.org/iframe/reserve.php" width="500" height="350" frameBorder="0"></iframe>
</div>
</body>
So HOW do I take...
$_SESSION['fName']['abc'];
$_SESSION['lName']['def'];
$_SESSION['address1']['ghi'];
$_SESSION['address2']['jkl'];
$_SESSION['country']['mno'];
$_SESSION['postal_code']['pqr'];
$_SESSION['city']['stu'];
$_SESSION['retUrl']['vwx'];
$_SESSION['decUrl']['yz'];
and turn it into the encoded url that I am looking for? Further once that is done how to I get the session vars back as session vars on that new domain iFrame page...😕
Yes I know I am asking for a lot of help here, but as before, I have gone over posts, threads, the PHP manual, for 16 days now and I am not any closer to doing this....OR if anyone has a better way I am open to that as well...
Thank You for taking and look and your time...