Re: Re: Passing variable to a page in a frameset
| From: | Dan Shirah | Date: | Fri, 15 Aug 2008 19:08:53 +0000 |
| Subject: | Re: Re: Passing variable to a page in a frameset | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278188@lists.php.net to get a copy of this message | ||
>
> That is exactly what I want. I apologize for the confusion. I was having a
> hard time trying to put what I was trying to do in words. But, yes, your
> second paragraph is exactly what I want to do. My knowledge of PHP is very
> limited, and I've tried to search for something that will do this, but
> couldn't find anything.
>
> - jody
In that case, I would not use frames at all. I believe in the top frame all
you wanted to store was the search text, right?
Just have your search link do something like this:
<html>
<head>
<script language="JavaScript">
<!--
function submitForm() {
document.search_form.action='
http://beta.menashalibrary.org/sites/beta.menashalibrary.org/themes/salamander/searchframe.html
';
document.search_form.submit();
}
//-->
</script>
</head>
<body>
<form name="search_form" method="post" action="">
<input type="text" name="search_name" value="">
<a href="javascript:submitForm()">SEARCH</a>
</form>
</body>
</html>
And then on
http://beta.menashalibrary.org/sites/beta.menashalibrary.org/themes/salamander/searchframe.html
just
assign your posted search value and make a hidden form field.
<html>
<head>
<body>
<?php
$searched_text = $_POST['search_name'];
?>
<form name="my_search" method="post" action="">
<input type="hidden" name="search_text" value="$searched_text">
<table width='800' border='0' align='center'
cellpadding='2' cellspacing='2'
bordercolor='#000000'>
<tr>
<td><?php echo "You searched for: ".$searched_text; ?></td>
</tr>
</table>
</form>
</body>
</html>