Note that there are some explanatory texts on larger screens.

plurals
  1. POphp form with radio buttons
    primarykey
    data
    text
    <p>I'm trying to get the following form to work. I want to be able to send the information from the text fields and radio buttons via email when the user submits the form. I also want the page to redirect to a 'thankyou' page after the form submits. As it currently stands, the page redirects but no email is sent. Here is what I currently have:</p> <p>HTML: </p> <pre><code> Name: &lt;input type="text" id="name" name="name" /&gt; Date: &lt;input type="text" id="date" name="date" /&gt; Job description: &lt;input type="text" id="job" name="job" /&gt; &lt;label for="yes"&gt;Yes&lt;/label&gt; &lt;input type="radio" id="Yes" name="q1" value="Yes"/&gt; &lt;label for="no"&gt;No&lt;/label&gt; &lt;input type="radio" id="No" name="q1" value="No"/&gt; &lt;label for="yes"&gt;Yes&lt;/label&gt; &lt;input type="radio" id="Yes" name="q2" value="Yes"/&gt; &lt;label for="no"&gt;No&lt;/label&gt; &lt;input type="radio" id="No" name="q2" value="No"/&gt; &lt;label for="yes"&gt;Yes&lt;/label&gt; &lt;input type="radio" id="Yes" name="q3" value="Yes"/&gt; &lt;label for="no"&gt;No&lt;/label&gt; &lt;input type="radio" id="No" name="q3" value="No"/&gt; &lt;input type="radio" id="Maybe" name="q3" value="Maybe"/&gt; &lt;label for="why"&gt;Why? (please state)&lt;/label&gt;&lt;input type="text" id="why" name="why"/&gt; &lt;input type="submit" id="message_submit" class="submit-button"/&gt; &lt;/form&gt; </code></pre> <p>PHP</p> <pre><code>&lt;?php $toaddress = "example@example.com"; $subject = "Subject"; $email = "sender@example.com"; $url = 'thankyou.php'; $msg = "$name\n"; $msg.= "$date\n"; $msg.= "$job\n"; $msg.= "$q1\n"; $msg.= "$q2\n"; $msg.= "$q3\n"; $msg.= "$why\n"; $mailheaders = "From: $email\n"; $mailheaders .= "To: recipient@example.com\n"; $mailheaders .= "Content-Type: multipart/mixed; \n"; mail($toaddress, $subject, $msg, $mailheaders); if($sent) echo '&lt;META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'"&gt;'; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload