Jump to content

Recommended Posts

Posted (edited)

I have been watching videos and have not found anything yet that can help me to get radio group to work See my code and see if you can help me. I have tried  different things I put XXXX in were I thing I need some thing I also think I need something in the first line were the form starts

 

<form  method="post"  name="form1" id="form1" action="survey.php">
      <p>
        <label>First Name
          <input type="text" name="fname" id="fname" />
        </label>
      </p>
      <p>
        <label>Last Name
          <input type="text" name="lname" id="lname" />
        </label>
      </p>
      <p>
        <label>Email
          <input type="text" name="email" id="email" />
        </label>
      </p>
       <p>
        <label>What state you from?
          <input type="text" name="state" id="state" />
        </label>
      </p>
      <p>
        <label> Would you like to see a nation wide pool? Winner by antler size.<br />
          <input type="radio" name="RadioGroup1" value="yes" id="RadioGroup1_0" />
          yes</label>
        <br />
        <label>
          <input type="radio" name="RadioGroup1" value="no" id="RadioGroup1_1" />
          no</label>
      </p>
      <p>
        <label> Would you like to see a Maine State wide pool? Winner by weight.<br />
          <input type="radio" name="RadioGroup2" value="yes" id="RadioGroup2_0" />
          yes</label>
        <br />
        <label>
          <input type="radio" name="RadioGroup2" value="no" id="RadioGroup2_1" />
          no</label>
      </p>
      <p>
        <label> Would you like to see a Sanford Maine local pool? Winner by weight. All deer would be put on the same scale in Sanford. <br />
          <input type="radio" name="RadioGroup3" value="yes" id="RadioGroup3_0" />
          yes</label>
        <br />
        <label>
          <input type="radio" name="RadioGroup3" value="no" id="RadioGroup3_1" />
          no</label>
      </p>
      <p>
        <label> Would you be willing to pay $10.00 for the Nation wide pool? <br />
          <input type="radio" name="RadioGroup4" value="yes" id="RadioGroup4_0" />
          yes</label>
        <br />
        <label>
          <input type="radio" name="RadioGroup4" value="no" id="RadioGroup4_1" />
          no</label>
        <br />
      </p>
      
      <p>
        <label>Comments <br />
          <textarea name="comments" id="comments" cols="45" rows="5"></textarea>
        </label>
      </p>
      <p>
        <input name="submit" type="submit" class="buttons" id="submit" value="Send" />
      </p>
    </form>
    <!--ends form-->
 
This PHP below is in a external file
 
<?php
 
/* Email Variables */
 
$emailSubject = 'survey!';
$webMaster = 'realmainer@gmail.com';
 
 
/* Data Variables */
 
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
XXXXXXXXXXXXXXXXXXXXX  I think I need something here for each group I have
XXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXX
$comments = $_POST['comments'];
 
 
 
$body = <<<EOD
<br><hr><br>
Name: $fname <br>
Name: $lname <br>
Email: $email <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
 
 
/* Results rendered as HTML */
 
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="2;URL=http://www.whitetaildeerpool.com">
 
 
-->
</style>
</head>
<div align="center">thank you for filling out our form !</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
Edited by realmainer

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...