Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:20:15+00:00 2026-06-04T16:20:15+00:00

Here is my contact form and you can see it here at benlevywebdesign.com at

  • 0

Here is my contact form and you can see it here at benlevywebdesign.com at the bottom of the page.

<form id="form1" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="text/plain" method="get">    

        <fieldset>
            <p class="form">
                <label for="name">Name</label>
                <input type="text" name="name" id="name" size="30" />
            </p>
            <p class="form">
                <label for="email">Email</label>
                <input type="text" name="email" id="email" size="30" />
            </p>
            <p class="form">
                <label for="web">Website</label>
                <input type="text" name="web" id="web" size="30" />
            </p>            
        </fieldset>
        <fieldset>                                                                          
            <p class="form">
                <label for="message">Message</label>
                <textarea name="message" id="message" cols="30" rows="10"></textarea>
            </p>                                
        </fieldset>                 

        <p class="submit"><button name="submit" type="submit">Send</button></p>

    </form>`

and here is the php code I am trying to switch from get to post. I don’t know that much php

<?php
        if(isset($_GET['submit'])){

            $to = "benlevygraphics@gmail.com";
            $headers = "From: " . $_GET['email'];
            $subject = "Ben, you have been contacted by...";
            $body = "Name: " . $_GET['name'] . "\nEmail: " . $_GET['email'] . "\nWebsite: " . $_GET['web'] . "\nMessage: " . $_GET['message'];
            if(mail($to, $subject, $body, $headers)){
                echo("<p>Your message has been sent!</p>");
            }
            else{
               echo("<p>Message delivery failed...</p>");
            }
       }

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:20:16+00:00Added an answer on June 4, 2026 at 4:20 pm

    First, get rid of your enctype attribute. You are setting it to text/plain about which the specification says:

    Payloads using the text/plain format are intended to be human readable. They are not reliably interpretable by computer

    Second, set method to "POST"

    Third, in the PHP use $_POST not $_GET

    Fourth, don’t output content from $_POST/GET/SERVER/ETC into an HTML document without first encoding it with htmlspecialchars. Otherwise you have a huge XSS security vulnerability.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am designing a webpage with a contact form that you can see here
I'm working on a PHP contact form, but I can't get it to work.
I'm sitting here wondering wheather this php contact form solution is too simple to
http://www.3dmark3t.com/contact.html 1 Here is my contact form I want to be able to only
Here's my problem: I'm trying to set up a simple mobile contact form with
Here is what I am currently doing. PHP echo's out the recent post in
I'm trying to recreate a sort of table layout of a contact form. Here's
I have a form on a website I'm working ( you can see it
Hey all, I have a basic HTML contact form that goes to a .php
I have a basic PHP form here that sends an email when submitted: <div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.