Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-21-2007, 10:31 PM   #1 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default 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>
Frank Shaw is offline   Reply With Quote
Sponsored Links
Old 06-27-2007, 11:00 PM   #2 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default Re: drop down menu drive a web page through a php server side script back to a iframe

If I add this to the bottom of my server side script PHP I want to pass several varables back to my orginal web page where the form is that the action was used to call the server side script.

How would you modify the code below to pass the variable foo fum bah pop so that I might stuff them in the proper field on the form in the orginal web page.


<?php

<p>
if ($something == true)
<meta http-equiv="Refresh" content= "0;URL=http://www.example.com/index-7.htm">;
else
<meta http-equiv="Refresh" content= "0;URL=http://www.example.com/failed.htm">;

</p>

?>
Frank Shaw is offline   Reply With Quote
Old 06-28-2007, 03:03 AM   #3 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default Re: drop down menu drive a web page through a php server side script back to a iframe

no, just send the header out as I had described. The <meta http-equiv="Refresh" content="0;URL=http://www.example.com/index-7.htm">; will not do what you want. Recall that the server side script can serve up content in addition to execute logic. You can tell the script to send out the appropriate page simply by sending out the correct http header. See my earlier example.
Frank Shaw is offline   Reply With Quote
Old 06-28-2007, 03:04 AM   #4 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default Re: drop down menu drive a web page through a php server side script back to a iframe

If I add this to the bottom of my server side script PHP I want to pass several varables back to my orginal web page where the form is that the action was used to call the server side script.

How would you modify the code below to pass the variable foo fum bah pop so that I might stuff them in the proper field on the form in the orginal web page.
Frank Shaw is offline   Reply With Quote
Old 06-28-2007, 03:05 AM   #5 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default Re: drop down menu drive a web page through a php server side script back to a iframe

Do I use a echo() or something else ?

<?php

<p>
if ($something == true)
<meta http-equiv="Refresh" content= "0;URL=http://www.example.com/index-7.htm">;
else
<meta http-equiv="Refresh" content= "0;URL=http://www.example.com/failed.htm">;

</p>

?>
Frank Shaw is offline   Reply With Quote
Old 06-28-2007, 03:07 AM   #6 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default Re: drop down menu drive a web page through a php server side script back to a iframe

So this one line will actual cause the index-7.php to be redisplayed again.



header("Location:".$index-7.php");



If that is true how can I pass some information back from my server sode script to when using the line above – that is I want to pass information – data back to my index-7.php whch is my client page.
Frank Shaw is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 11:01 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums