Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy does this php contact form just download contact.php?
    primarykey
    data
    text
    <p>i'm a total n00b when it comes to PHP (and arguably, web development in general :/), but i've taken a look at a ton of examples, comparing my code, and i just can't figure it out. basically all thats happening is the contact.php file is just getting downloaded to my computer. ugh. also, this client did not ask for any field validation, which is why theres none there. help!!</p> <p>heres my html- </p> <pre><code>&lt;form action="contact.php" method="post"&gt; &lt;fieldset&gt; &lt;legend&gt;&lt;strong&gt;Get A Quote!&lt;/strong&gt; &lt;/legend&gt; Call me at 555-555-5555, or email me at &lt;a href=""&gt;email@emaiul.com&lt;/a&gt;, or use the form below.&lt;br /&gt;&lt;br /&gt; &lt;div class="clearfix"&gt; &lt;div class="input"&gt; &lt;input style="width:370px; height:35px; font-size:14px;" value="Name" name="name" size="50" type="text"&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /clearfix --&gt; &lt;div class="clearfix"&gt; &lt;div class="input"&gt; &lt;input style="width:370px; height:35px; font-size:14px;" value="Email" name="email" size="50" type="text"&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /clearfix --&gt; &lt;div class="clearfix"&gt; &lt;div class="input"&gt; &lt;input style="width:370px; height:35px; font-size:14px;" value="Phone" name="phone" size="50" type="text"&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /clearfix --&gt; &lt;div class="clearfix"&gt; &lt;div class="input"&gt; &lt;textarea style="width:370px; height:55px; font-size:14px;" name="message" size="50" type="text"&gt;Message&lt;/textarea&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /clearfix --&gt; &lt;/fieldset&gt; &lt;button type="submit" name="saveForm" style="background-image: url(static/img/btn-submit.png); width:150px; height:37px;"&gt;&lt;/button&gt; &lt;/form&gt; </code></pre> <p>and the php- </p> <pre><code>&lt;?php if(isset($_POST['saveForm'])) { $to = "steven@urethrafranklin.org"; $subject = "Inquiry from website"; $name_field = $_POST['name']; $email_field = $_POST['email']; $phone_field = $_POST['phone']; $message = $_POST['message']; $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message"; mail($to, $subject, $body); } else { echo "Sorry, something went wrong. Please email me at user@user.com."; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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