Hi,
Saturday, February 21, 2004, 8:00:43 AM, you wrote:
SM> My apologies if this post is somewhat OT. I am having some trouble
SM> figuring something out, and I am hoping you can help.
SM> I have a PHP web form on which a user can enter a number of different
SM> things
SM> into both text and textarea fields. At the bottom of the form is a
SM> preview button which opens another browser window.
SM> I know I can use the GET string to pass these form fields from one
SM> PHP page to another, but with
SM> textareas involved and the possibly large amounts of text being
SM> passed, I didn't want to run the possibility of overrunning the limit
SM> on a GET string. So I figured using a form POST would be more
SM> appropriate.
SM> My thought was to create a self submitting form in the child window, but
SM> I am having
SM> trouble getting it to work (or maybe I should try a different method
SM> entirely to do this...any suggestion welcome!). My code for the
SM> preview window (which contains the self submitting form is as
SM> follows:
SM> <?
SM> if ($do_preview) {
SM> echo $myvar; exit;
SM> }
?>>
SM> <HTML>
SM> <HEAD>
SM> <TITLE></TITLE>
SM> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
SM> </HEAD>
SM> <BODY onLoad="document.preview_form.submit()" BGCOLOR="#FFFFFF"
SM> TEXT="#000000" LINK="#000000"> <FORM NAME="preview_form" METHOD="post"
SM> ACTION="<? echo $PHP_SELF ?>">
SM> <INPUT TYPE="hidden" NAME="do_preview" VALUE="1">
SM> <script>
SM> document.write('<INPUT TYPE="hidden"
SM> NAME="myvar"VALUE="'+opener.myform1.myvar1.value+'">');
SM> </script>
SM> </FORM>
SM> </BODY>
SM> </HTML>
SM> (I also tried doing an eval within the VALUE attribute, but all that did
SM> was set myvar to the text that I had between the quotes :) )
SM> When I click the preview button on the parent window, I would like to
SM> see the value of the myvar1 variable when the form self
SM> submits...unfortunately, I get nothing. I know it is getting into my
SM> $do_preview block at the top, and I am accessing the variable
SM> correctly because if I do an alert(opener.myform1.myvar1.value), I
SM> get the proper value.
SM> Any thoughts would be greatly appreciated!
SM> --Sam
SM> --
SM> PHP General Mailing List (http://www.php.net/)
SM> To unsubscribe, visit: http://www.php.net/unsub.php
You need to use sessions to store the data between pages
--
regards,
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php