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

  • Home
  • SEARCH
  • 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 7059071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:11:18+00:00 2026-05-28T04:11:18+00:00

Ok I have our contact form fully working, and processing correctly. I have two

  • 0

Ok I have our contact form fully working, and processing correctly. I have two questions …

  1. on the contact form page , I wish to add a checkbox for user to tick to send copy of the email to them aswell.

  2. on the process form part I want to redirect to error page if all goes horribly wrong.

Currently on my form submit i have action going to thankyou.php

My form process i have added within the thankyou.php page but could pull it out separately if needed.

…………………………………

My form process is below ( very very simple )

<?php

$youremail = "someonesemail@email.com";

$yourname    = $_POST['yourname'];
$email   = $_POST['email'];
$location = $_POST['location'];
$textarea = $_POST['textarea'];

 $headers = "From: $email";

$content = "Hello there! This is a message from your contact form.\r\n
\r\n
\r\n
Name: $yourname\r\n
\r\n
E-mail: $email\r\n
\r\n
Location: $location\r\n
\r\n
Message: $textarea\r\n\r\n";

$send = mail($youremail, 'Message from your conatct form', $content, $headers);

 if($send)
 {
echo "ok";
 }

Im not brill with php so any help appreciated

  • 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-05-28T04:11:18+00:00Added an answer on May 28, 2026 at 4:11 am
    <?php
    $youremail  = "someonesemail@email.com";
    $yourname   = $_POST['yourname'];
    $email      = $_POST['email'];
    $location   = $_POST['location'];
    $textarea   = $_POST['textarea'];
    $ReceiveMail= $_POST['txtReceive'];
    
    if($ReceiveMail == "yes") {
        $content    = "";
        $headers    = "From: $email";
        @mail($email, 'Mail Notification', $content, $headers);
    }
        $headers    = "From: $email";
        $content = "Hello there! This is a message from your contact form.\r\n
        \r\n
        \r\n
        Name: $yourname\r\n
        \r\n
        E-mail: $email\r\n
        \r\n
        Location: $location\r\n
        \r\n
        Message: $textarea\r\n\r\n";
        $send = mail($youremail, 'Message from your conatct form', $content, $headers);
        if($send)    {
            header("location:thankyou.php");
            exit;
        }
        else {
            header("location:error.php");
            exit;
        }
    ?>
    

    I have added one checkbox in form and check the value in server side.
    Try this. Hope it will help

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

Sidebar

Related Questions

We have a website that emails the contents of a contact form to our
I have an intranet application that needs contact information for various locations on our
We have our domain model declared in rusty old hbm files, we wish to
We don't currently have our SQL Server objects in any form of source control.
Let's say you have two kinds, Message and Contact, related by a db.ListProperty of
I have contact management / CRM application used in-house by our company, It is
The basics: I have a contact form that uses php to validate the forms.
I have a contact form on site which used to work, but since last
Hi I'm trying to add some another field to this php contact form I
We are developing a contact form for a SaaS application; each instance of our

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.