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 8457635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:51:31+00:00 2026-06-10T12:51:31+00:00

I am new to PHP, but, I have a simple contact form that is

  • 0

I am new to PHP, but, I have a simple contact form that is sending to my email. Everything works as expected except the $message variable is not displaying.

The php is processing the request and sending the website viewer to the thank you page, viewer is also getting confirmation email, and I am receiving the email with all requested variables except the $message data.

The variables are consolidated into $totalmessage due to the mail() function limits.

As I said, I am new to php, but appreciate your help.

PHP code:

<?php

    $to = "me@mywebsite.com";
    $subject = "Inquiry";
    $name = $_REQUEST['name'] ;
    $email = $_REQUEST['email'] ;
    $phone = $_REQUEST['phone'] ;

    if (isset($_POST['interest']) && $_POST['interest']!= 'none'){ 

        if (is_array($_POST['interest'])){ 
            $interest = implode(" ", $_POST['interest']); // format your array for use 
        } else { 
            $interest = $_POST['interest']; // no array -> print single value 
        } 
    } 
    $method = $_REQUEST['method' ] ;
    $message = $_GET['message'] ;
    $totalmessage = "
        Name:       $name \n
        Email:      $email \n
        Phone:      $phone \n
        Interest:           $interest \n
        Method:     $method \n 
        Message:             $message \n ";
    $headers = "From: $email";

    $sent = mail($to, $subject, $totalmessage, $headers);
    if($sent)
        header( "Location: /thankyou.html" );
    else
        print "We encountered an error sending your mail";
?>

HTML code:

<div class="row">
    <br><label for="message"> Message:</label><br/>
    <textarea name="message" rows="20" cols="20" id="message"></textarea>
</div>

Email Output:

            Name:           bob

            Email:          bob@gmail.com

            Phone:          123-456-7890

            Interest:       research

            Method:         email

            Message:                               <===should have message text
  • 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-10T12:51:33+00:00Added an answer on June 10, 2026 at 12:51 pm

    You shouldnt use the GET variable for sending the message.
    The URL can only send 255 letters! So the best is to send it with POST.

    <form method="post" action="index.php?action=send">
    <textarea name="message" rows="20" cols="20" id="message"></textarea>
    </form>
    

    and in ur php:

    $message = $_POST['message'] ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have developed a simple php contact form, that's working fine, but i am
Hi I am new to PHP and have a simple problem but I have
I am pretty new to php, but I am learning! I have a simple
I'm trying to create a simple message form using navigateToURL() and PHP mail(). But
I have a pretty simple question but I am really new to php. I
I need a very simple, but effective PHP form handler that will work with
I am fairly new to php and mysql but I have created a small
I am fairly new to PHP, but have applied my previous knowledge of programming,
I think this is mostly because I'm new to PHP OOP, but I have
I am new to VBA but have previous experience with PHP programming logic and

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.