Posted by Stefan Mueller on 11/15/05 12:36
I've a frameset (test-submit-main.html) with 2 frames. The user works within
frame 1 (test-submit-frame1.html). In frame 2 (test-submit-frame2.html) I
collect some data which are stored in hidden fields. If the user presses
submit, the hidden fields of frame 2 gets sumbitted.
Unfortunately the output generated by PHP (test-submit.php) is shown in
frame 2.
Does someone know how to tell PHP to send the data to frame 1?
Stefan
++++++++++++++++++++++++++++++++++++++++++++++++
test-submit-main.html
=====================
<html>
<frameset rows = "*, 200" frameborder = "0" framespacing = "0">
<frame src="test-submit-frame1.html" name="MyFrame1">
<frame src="test-submit-frame2.html" name="MyFrame2">
</frameset>
</html>
++++++++++++++++++++++++++++++++++++++++++++++++
test-submit-frame1.html
=======================
<html>
<body>
<form name = "MyFormFrame1" action = "" method = "post" accept-charset =
"iso-8859-1">
<input type = "button" value = "Submit" onClick =
"eval(parent.frames[1].document.MyFormFrame2.submit())">
</form>
</body>
</html>
++++++++++++++++++++++++++++++++++++++++++++++++
test-submit-frame2.html
=======================
<html>
<body>
<form name = "MyFormFrame2" action = "test-submit.php" method = "post"
accept-charset = "iso-8859-1">
<table id = "MyTableFrame2">
<input type = "text" name = "MyField1" value = "Content Field 1">
</table>
</form>
</body>
</html>
++++++++++++++++++++++++++++++++++++++++++++++++
test-submit.php
===============
<html>
<body>
<?php
echo "MyField1: " . $_POST['MyField1'];
echo "This message should be displayed in frame 1 and not in frame
2!";
?>
</body>
</html>
++++++++++++++++++++++++++++++++++++++++++++++++
[Back to original message]
|