I have a Wordpress website that needs to display a 3rd party newsletter signup form. This sign-up form has lots of fields and takes up its own full page.
I want to display a simple "enter email address, hit submit" form at the top of every page. When the user hits submit, it should take them to the full form, where their email address is already pre-populated in the appropriate field.
What's a good way to pass t开发者_如何学JAVAhe input value from the short form to the long form? I'm inclined to use the URL somehow, but I've never approached it before.
(My skills: expert XHTML/CSS. competent with WP theme hacking. comfortable enough with PHP and Javascript to move things around, but not enough to write them from scratch.)
Thanks!
ETA: Here's the shell of what worked (thanks for the solutions!):
Form One
<form method="get" action="form2.php">
email:
<input type="text" name="email" value="" />
<input type="submit" />
</form>
Form One (form2.php)
<form>
Email field:
<input type="text" value="<?php echo $_GET["email"]; ?>" />
</form>
you just send the value of the first email form via the get or post method and in the php/html for the second form use <input type="text" name="email" value"$_POST['firstFormsName']" />
of course this example assumes you're using the post method in your form on the first page.
精彩评论