CoolAffiilate Posted November 8, 2007 Share Posted November 8, 2007 I am very new to PHP, and I dont know if this is even possible. I will try to explain the best I can. A person votes for something, and once they click submit a prompt pops up and asks for the e-mail address. They input the e-mail address into the prompt, then the e-mail address is passed to the next page. Would this be possible, and how would I go about doing it? Quote Link to comment Share on other sites More sharing options...
LemonInflux Posted November 8, 2007 Share Posted November 8, 2007 you could have the email form on the page, and then on the next page have <?php $email = $_POST['whatever you called the email field']; ?> and then $email would be the email address. As for the popup, I'm not sure. Javascript would do that I guess. Quote Link to comment Share on other sites More sharing options...
Barand Posted November 8, 2007 Share Posted November 8, 2007 here's one way using javascript and a hidden form field <?php if (isset($_GET['sub'])) { echo 'Email ', $_GET['email'], '<br/>'; echo 'Rating ', $_GET['rating'], '<br/>'; } ?> <html> <head> <meta name="generator" content="PhpED Version 4.5 (Build 4513)"> <title>Sample</title> <meta name="author" content="Barand"> <script> function doSubmit() { var email = prompt("Please enter you email address",""); document.getElementById("email").value = email; return email != ""; } </script> </head> <body> <form onsubmit="return doSubmit()"> <input type="hidden" name="email" id="email" value=""> Rating <input type="radio" name="rating" value="1">1 <input type="radio" name="rating" value="2">2 <input type="radio" name="rating" value="3" checked>3 <input type="radio" name="rating" value="4">4 <input type="radio" name="rating" value="5">5 <br/> <input type="submit" name="sub" value="Vote"> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.