help needed in frames with php/html

liunx

Guest
Hi, <br />
<br />
I have been trying to do this for sometime now, and i am getting frustratted. <br />
<br />
i have a form that takes 2 variables (dates). the action of the form is set to index.php (a page with 2 frames) the index.php has one frame called mainmenu.php, which is a script that extracts data from MySQL using the 2 variables entered in the form. <br />
<br />
The index.php is not working as required, as the variables form the form are placed in index.php, rather than mainmenu.php. if i change the action to mainmenu.php. it works, but only the mainmenu is displayed, index.html is not. <br />
<br />
Please help. <br />
<br />
Regards, <br />
Mel<!--content-->try modifing the index.php like this:<br />
index.php<br />
---------<br />
<br />
<br />
print "<frameset blah ";<br />
print "<frame src='http://www.htmlforums.com/archive/index.php/mainmenu.php?datedata1=".$datedata1fromtheform."&datedata2=".$datedata2fromtheform."' blah >";<br />
print "<frame src='http://www.htmlforums.com/archive/index.php/otherpagenamegoeshere.php' blah >";<br />
print "</frameset> ";<!--content-->I have changed as you suggested, but still no output.<br />
<br />
click the links above, i have changed index.php<br />
<br />
thanks,<br />
Mel<!--content-->Click what link?<br />
Anyway, in theory I think the code ucm supplied should work, if written correctly. This is my go at it:<br />
<br />
<br />
<frameset><br />
<frame src=http://www.htmlforums.com/archive/index.php/"mainmenu.php?date1=<? echo $_POST["date1_from_form"]; ?>&amp;date2=<? echo $_POST["date2_from_form"]; ?>"><br />
<frame src=http://www.htmlforums.com/archive/index.php/"theotherpage.php"><br />
</frameset><br />
<br />
<br />
So this way I guess it should work. Set the form's action to "POST" and then you can fetch date1 and date2 in mainmenu.php as $_GET["date1"] and $_GET["date2"]... <br />
<br />
Maybe it would even work to just set the form's action to "GET" and then get it from mainmenu.php, I dont know how it works in framesets.. but maybe not, so try the first method I suggested.<!--content-->sorry,<br />
<br />
ok, here is my files:<br />
<br />
-----------------<br />
<form method="get" action="mainmenu.php" name="search"><br />
<h2>Images</h2><br />
<p>Start Date</p><br />
<br />
<br />
<p> <br />
<input type="text" name="startdate" size="19" maxlength="19"><br />
</p><br />
<p>End Date</p><br />
<p> <br />
<input type="text" name="enddate" size="19" maxlength="19"><br />
</p><br />
<br />
<p><br />
<input type="submit" name="Submit" value="Send Data"><br />
</p><br />
<br />
<br />
</form><br />
<br />
--------------------------------------------<br />
<br />
<br />
<HTML><br />
<HEAD><br />
<TITLE> Welcome to my Web site! </TITLE><br />
</HEAD><br />
<br />
<FRAMESET FRAMEBORDER=0 COLS="150,*"><br />
<br />
<frame NAME="menu" noResize src=http://www.htmlforums.com/archive/index.php/"mainmenu.php"><br />
<FRAME NAME="main" SRC=http://www.htmlforums.com/archive/index.php/"welcome.html"><br />
<br />
</FRAMESET><br />
<br />
<NOFRAMES><br />
<H1>Welcome!</H1> <P>This site was designed to use frames to provide a menu bar to ease navigation; however, your browser does not support frames. Click <A HREF=http://www.htmlforums.com/archive/index.php/"welcome.html">here</A> to go to the main page of our site, where you can use the alternative links we have provided to get around the site.<br />
</NOFRAMES><br />
<br />
</HTML> <br />
<br />
-----------------------------<br />
<br />
extract from mainmenu.php<br />
<br />
<br />
$echo_startdate = $HTTP_GET_VARS["startdate"]; // echo the values inserted startdate in the search form<br />
echo "<font size=1>start date = $echo_startdate <br></font>";<br />
<br />
$echo_enddate = $HTTP_GET_VARS["enddate"];// echo the values inserted startdate in the search form<br />
echo "<font size=1>end date = $echo_enddate</font><p>";<!--content-->hmm that form is pointing to mainmenu.php, but it should be index.php right?<br />
Doesnt it even work with mainmenu.php as action?<br />
I dont know why it wouldnt work like you have it below.. I use the $_GET array, as I think HTTP_GET_VARS is deprecated, or?<!--content-->hi,<br />
<br />
thanks for the help, yes it worked when i pointed it to mainmenu.php. but not with index.php.<br />
<br />
i think maybe there is a variable missing?<br />
<br />
could you please look at it?<br />
<br />
Cheers,<br />
mel<!--content-->try changing:<br />
<br />
<form method="get" action="mainmenu.php" name="search"><br />
<br />
to:<br />
<br />
<form method="post" action="index.php" name="search"><br />
<br />
<br />
---------<br />
<br />
and also change:<br />
<br />
<frame NAME="menu" noResize src=http://www.htmlforums.com/archive/index.php/"mainmenu.php"><br />
<br />
to:<br />
<br />
<frame NAME="menu" noResize src=http://www.htmlforums.com/archive/index.php/"mainmenu.php?startdate=<? echo $startdate; ?>&enddate=<? echo $enddate; ?>"><br />
<br />
---------<br />
<br />
<br />
try viewing the source on the mainmenu.php frame and see what it shows was echo'd from php...<br />
<br />
<br />
<br />
If that doesn't work then try printing the values of those two variables in index.php to see if their values are coming in ok ( use <? print $startdate; print "<br>"; print $enddate; ?><br />
<br />
let us know what exactly happened when you tried this code, please<!--content-->
 
Back
Top