drop down menu drive a web page through a php server side script back to a iframe
NEED SOME OR A LITTLE BIT OF HELP ON THIS WHAT IS THE BEST WAY TO DO WHAT I AM TRYING TO DO?
HERE IS WHAT I AM TRYING TO DO SIMPLY PUT I HAVE A HTML WEB PAGE ON THE PAGE TWO ITEMS A DROP DOWN MENU WHERE A USER CAN SELECT SEVERAL OPTIONS – DEPENDING ON THE OPTION SELECTED WILL DEPEND ON WHAT IS DISPLAYED ON THE SAME PAGE BUT THIS TIME THE IFRAME BECOMES VISABLE TO THE USER OR I CAN HAVE THE DEFALULT INFORMATION HTML DIPLAYED IN IT WHEN THE WEB PAGES IS DISPAYED THE FIRST TIME.
THE POINT IS BY MAKING A SELECTION IN THE DROPDOWN MENU THE INFORMATION DISPALYED IN THE IFRAME WILL CHANGE AND A DIFFERENT HTML OR PHP PAGE WILL BE DISPLAYED IN THE IFRAME.
BUT I WANT THE PROCESSING OF WHAT WAS SELECTED IN THE DROP DOWN MENU BE PARSED IN A SERVER SIDE SCRIPT USING PHP AND AFTER THE PARSEING IS DONE I WANT THE INDEX-7 PAGE TO BE REDISPLAYED – REFRESHED – WITH THE NEW INFORMATION – HTML IN IT.
NOW THE NEW INFORMATION OR HTML IS STATIC WHERE I WILL HAVE A WEB PAGE FOR THE INFORMATION FOR EACH SELECTION TO BE MADE IN THE DROP DOWN MENU ALL READY CANNED TO BE INSERTED ON TO IFRAME BEFORE IT GETS REDISPLAYED.
<br>
<form name="form1" method="post" action="lodges.php" target="_blank">
<label for="select">Select Lodge from List</label>
<select name="select" id="select">
<option value="lodgeage1" selected> John T heard - Ipswich Mass </option>
<option value="lodgepage2"> Essex - Salam Mass </option>
</select>
</form>
<br>
The above option in the above form on the index-7.php page calls a server side PHP script which is to parse the value property that has been selected and submit to the server side php script.
The following is the sever side php script
<?
/* make the "action" of the form go to that form */
if(sizeof($_POST)) {
$body = "";
while(list($key, $val) = each($HTTP_POST_VARS)) {
if ($key != "submit")
$body .= "$key: $val \n";
}
echo $body
/* this is what i want to do
if lodgapage1 then modfiy the src="johntheard.php" in index-7 is the id="ifrm" the iframe on the index-7.php web page and then redisplay the page.
if lodgapage2 then modfiy the src="essex.php" in index-7 is the id="ifrm" the iframe on the index-7.php web page and then redisplay the page.
But how do I do it ????
*/
echo "<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"0; URL=index-7.php\">";
}
// end form processing
?>
__________________________________________________ __________________________________________________ __________________________________________________ ______
This is the iframe code that contains in the index-7.php
Is the use of a iframe a bad thing or a good thing in this application ?
The Iframe needs to expland and contract according to the amount of HTML on the page being inserted in to the actual iframe.
The value src="lodgehistroy.php" is actual html that is to displayed in the iframe on this page
The id="ifrm" and name="ifrm" are the same right now and only come in to be a issue if more then one iframe is on the page
<br>
<iframe id="ifrm" name="ifrm" src="lodgehistroy.php" scrolling="no"
width="400" height="100" frameborder="0">
</iframe>
<br>
|