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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:17:30+00:00 2026-06-07T10:17:30+00:00

I am trying to create a HTML5 contact form compatible with computer and mobile

  • 0

I am trying to create a HTML5 contact form compatible with computer and mobile devices, when I clicked on send message it jumps into a blank white screen. I do get a email but it contains no information. I am quite new with PHP.

For http://www.rare1.ca/test:

<!DOCTYPE html>
<html>
<head>
<title>Responsive HTML5/CSS3 template</title>
<meta charset="utf-8" />
<meta name = "viewport" content = "width=device-width, maximum-scale = 1, minimum-    scale=1" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="all" />
<link rel="stylesheet" href="css/flexslider.css" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css' />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">    </script>
<script src="js/jquery.flexslider.js"></script>
<script src="js/default.js"></script>
<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="pagewidth">
    <header id="header">
        <div class="center">
            <nav id="mainNav">
                <ul>
                    <li class="active"><a href="#pagewidth"><span>gallery</span></a></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li><a href="#contactUs"><span>contact us</span></a></li>
                </ul>
            </nav>
        </div>
    </header>
    <div id="content">
        <section class="row">
            <div class="center">
              <h1><img src="img/logo.gif" width="142" height="78"></h1>
                <strong class="subHeading">Coming soon</strong>
                <div class="gallery">
                    <ul class="slides">
                        <li><img src="img/img-gallery.jpg" alt="image" /></li>
                        <li><img src="img/img-gallery2.jpg" alt="image" /></li>
                        <li><img src="img/img-gallery3.jpg" alt="image" /></li>
                    </ul>
              </div>
                <div class="buttons"></div>
          </div>
        </section>
        <section id="contactUs" class="row grey">
            <div class="center">
                <h1>Contact Us</h1>
                <strong class="subHeading">lorem ipsum dolor sit amet, consectetur adipiscing elit</strong>
                <div class="columns">
                    <div class="half">
                        <form action="sendemail.php" class="form">
                            <fieldset>
                                <h2>Feedback form</h2>
                                <div class="formRow">
                                    <div class="textField"><input type="text" name="Name" id="name" placeholder="Your name ..." /></div>    
                                </div>
                                <div class="formRow">
                                    <div class="textField"><input type="text" name="Email" id="email" placeholder="Your Email ..." /></div>
                                </div>
                                <div class="formRow">
                                    <div class="textField"><textarea name="Message" cols="20" rows="4" placeholder="Your message ..."></textarea> </div>
                                </div>
                                <div class="formRow">
                                    <button class="btnSmall btn submit right">
                                                <span>Send Message</span>
                                    </button>
                                </div>
                            </fieldset>
                        </form>
                    </div>
                    <div class="half">
                        <h2>How to find us</h2>
                        <div id="map">
                            <div class="imgHolder"><img src="img/map.jpg" alt="google map" /></div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <footer id="footer">
        <div class="center">

        </div>
    </footer>
</div>
</body>
</html>

<?php

// This is the script for sending email.


// change the email address below to your own email address.
$mailTo = 'info@rare1.ca';


$name = htmlspecialchars($_POST['Name']);
$mailFrom = htmlspecialchars($_POST['Email']);
$message_text = htmlspecialchars($_POST['Message']);

$headers  = "From: $name <$mailFrom>\n";
$headers .= "Reply-To: $name <$mailFrom>\n";

$message = $message_text;

mail($mailTo, $subject, $message, $headers );

?>
  • 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-07T10:17:32+00:00Added an answer on June 7, 2026 at 10:17 am

    In your php script you are sending the mail, but after that you do nothing!, there is no echo.

    Add at the end, after sending the mail:

    echo "Mail sent";
    

    And you’ll see that message appears.

    EDIT:

    In order to pass a message to the hompage, you need to put the message in the session and then redirect to the hompage:

    $_SESSION['myMsg'] = "some message";
    header("location: /hompage.php");
    

    Now, on the hompage, add somewhere in the script where you want to add the message:

    if (isset($_SESSION['myMsg'])){
        $message = $_SESSION['myMsg'];
        //do something with message
    }
    

    It is also a good idea to clean the session when done, you can do it using:

    session_unset(); // clears all session varaibles
    
    unset($_SESSION['myVar']); // clear specific variable
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple contact form for my MVC app. So far
I am trying to create a contact form on my website using PHPMailer. I
I am trying to create an HTML5 input date component so that I can
I'm trying to create text in html, that once clicked, the the value of
I'm trying to create a html5 and javascript based welcome display/kiosk for a building
New to rails 3 I would like to create a contact form that people
I'm trying to implement a captcha into a form. There are three files: the
I'm currently trying to create buttons which are in the form of loosely stacked
I am trying to create an Adobe Air Application, or making basic Mobile Apps
I'm trying to create an HTML5 game, which I'd like to work in modern

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.