Jump to content

[SOLVED] Help With PHP Please


CoolAffiilate

Recommended Posts

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?

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.