Jump to content

Problem passing variable / loading popup


Kane250

Recommended Posts

I have a page that has a form where someone enters their email address. The submit button launches a popup window which loads a second page that asks for first and last name, and also has the e-mail address field (which should be auto filled from the previous form entry).

 

I'm trying to make sure the second page only loads in the popup window and not the main window, which I have achieved. However, the email address from the first page is not carrying over to the form in the second page.

 

Can someone take a look and see what could be wrong?

 

Thanks!

 

Code for Page 1


<script>
<!--
function wopen(url, name, w, h)
{
w += 20;
h += -20;
var win = window.open(url,
 name,
 'width=' + w + ', height=' + h + ', ' +
 'location=no, menubar=no, ' +
 'status=no, toolbar=no, scrollbars=no, resizable=no');
win.resizeTo(w, h);
win.focus();
}
// -->
</script>


</head>

<body>

<form method="post"/>
<p>	E-Mail Address: <input type='text' value="" name="email" /><br />
<input type='submit' onClick="wopen('mainsub.php', 'popup', 400, 375); return true;" value="Sign Me Up!"/><br />

</form>


 

Code for Page 2

<form method="post" action="mainsub.php" />

<p>	

First name: <input type='text' value="" name="firstname" /><br /><br />

Last name: <input type='text' value="" name="lastname" /><br /><br />

E-Mail Address: <input type='text' value="<?PHP print $emailaddy ?>" name = "email" /><br />

<br />

<input type='submit' value="Submit!" name="submit" /><br />

Link to comment
https://forums.phpfreaks.com/topic/107386-problem-passing-variable-loading-popup/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.