I have an app that needs to pass form data to a framed page. The data then needs to be passed to one of the frame windows in the frame src url.
I struggled a bit and then came up with this solution. If anyone knows an easier way, please let us know!
BC
================================
Frame Page Code
// this is a test to see what vars are passed...
$qstring="?dummyvar=";
$br="<br>";
while ($element = each($HTTP_POST_VARS))
{
if (is_array($element["value"])) {
$qstring .= "&" . $element["key"] . "=" . urlencode(implode("|", $element["value"]));
} else {
$qstring .= "&" . urlencode($element["key"] . "=" . $element["value"]);
}
}
// $qstring = urlencode($qstring);
// urlencoding here doesn't work....
// the above works... now the question is, can I pass these variables along to a page?
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<frameset rows="64,*">
<frame name="header" scrolling="no" target="main" src="result_nav.htm">
<frame name="main" src="showresults.php<? echo "$qstring"; ?>">
<noframes>
<body>
.
.
.
================================
Now the showresults.php detail page
// this is a test to see what vars are passed...
$br="<br>";
while ($element = each($HTTP_GET_VARS))
{
$thisvar = urldecode($element["value"]);
if (strpos($thisvar,"|") > 0) {
// this is an array item....
$arrayin=explode("|",$thisvar);
$x=count($arrayin);
echo $element["key"] . $br;
for ($i=0; $i < $x; $i++) {
echo " " . $arrayin[$i] . $br;
}
} else {
echo $element["key"] . " - " . $thisvar . $br;
}
}
================================
The above echoes the correct variables and values so I can do what I want to do. Again, if I'm missing something and there's a better way, please post a reply!
BC:p