I Have an email signup form in my website but I am looking to add a signup to my front page with just one line "email address" and then on submit the email address would carry over to the form for them to fill out the rest of the form! Could someone please let me how to go about get this one line on my front page to carry over to the form on the sign up page? Thanks for your time! Adam
Hi. Supposed that you know how html form works, just 1. change form method on front page to email sign up form page. 2. retrieve input data from $_GET/$_POST. Dan
On first page, index.php <form id="emailform" method="post" action="getemail.php"> <input type="text" id="email" /> </form> Code (markup): Then on getemail.php form blah blah <input type="text" id="custemail" value="<?php echo $_POST["email"]; ?>" /> form blah blah Code (markup): Should work in theory, probably minor syntax error, but that is the basic idea.
I added (value="<?php echo $_POST["fields_email"]; ?>") to the input of the email field in the php file and it shows up in the value of the html document. Would it matter if the files are html but calling up the php forms. This is what my index page has for the code; <div style="outline: 1px solid #111; border-top: 1px solid #555; background: #333; color:#fff; padding:5px;width:171px;display:block; text-align:center;"> <form id="emailform" method="post" action="http://site.racefandiecast.com/contact-signup.html"> <input type="text" value="Email Address" class="input" id="fields_email" onclick="if(this.value=='Email Address') { this.value=''; }" onblur="if(this.value=='') { this.value='Email Address'; }" style="background-image:url(http://site.racefandiecast.com/header/header2/images/search-text.png); background-position:center; text-shadow: 1px 1px 1px #FFF; width: 155px; height:16px; padding:7px; border:0px;" /> <input style="margin:5px 0px 0px 5px;width:83px;" type="submit" value="Subscribe" /> </form> Code (markup): Thanks for the help! Adam
use it as link.html?email=email@address.com Try this code : <form id="emailform" method="post" action="http://site.racefandiecast.com/contact-signup.html"> <input type="text" value="<?php echo (isset($_GET['email']) ? $_GET['email'] : 'Email Address';?>" class="input" id="fields_email" onclick="if(this.value=='<?php echo (isset($_GET['email']) ? $_GET['email'] : 'Email Address';?>') { this.value=''; }" onblur="if(this.value=='') { this.value='<?php echo (isset($_GET['email']) ? $_GET['email'] : 'Email Address';?>' }" style="background-image:url(http://site.racefandiecast.com/header/header2/images/search-text.png); background-position:center; text-shadow: 1px 1px 1px #FFF; width: 155px; height:16px; padding:7px; border:0px;" /> <input style="margin:5px 0px 0px 5px;width:83px;" type="submit" value="Subscribe" /> </form> PHP: