0

Here is my code for this page: phileaton.est-a-la-masion.com/Day Care/contact.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <META NAME="description" CONTENT="Looking for an affordable daycare for your child? Are you worried that your precious one is not learning basic skills? If so, this is the place for you! Little Lights Daycare is a professional home-based facility where your child will learn social skills, skills necessary for school, self-respect, and respect for others in a Christian environment. ">
    <META NAME="keywords" CONTENT="daycare, little lights, child, lancaster, pa, 17554, 17601, 17603, rohrerstown, mountville, east pete, east petersburg, landisville, education, school, centerville, babies, toddlers, care, day, christian, love, affordable, save, money, cheap">
    <META NAME="robot" CONTENT="index,follow">
    <META NAME="generator" CONTENT="www.onlinemetatag.com">
    <META NAME="revisit-after" CONTENT="7">
    <link rel="stylesheet" href="style.css" type="text/css" />
    <link rel="SHORTCUT ICON" href="flame.ico" type="image/x-icon">
    <?php 
        if(isset($_POST['submit'])) {
            require_once("class.phpmailer.php");

    $mail = new PHPMailer();

    $mail->IsSMTP();
    $mail->Mailer = "smtp";
    $mail->Host = "ssl://smtp.gmail.com";
    $mail->Port = 465;
    $mail->SMTPAuth = true;
    $mail->Username = "philovesdogs@gmail.com";
    $mail->Password = "fsdafsdfjkljkldfs";
    $mail->ClearAddresses();
    $mail->isHTML(true);

    $mail->AddAddress('philovesdogs@gmail.com');

    $from = $_POST['email'];
    $mail->From = $from;

    $name = $_POST['name']; 
    $mail->FromName = $name;

    $subject = $_POST['subject'];
    $mail->Subject = $subject;

    $phone = $_POST['phone'];
    $message = $_POST['message'];
    $body = "From: ".$name."<br />Email: ".$from."<br />Phone: ".$phone."<br />Message:<br />".$message;
    $mail->Body = $body;

    if(!$mail->Send()) {
        echo 'Message was not sent.';
        echo 'Mailer error: ' . $mail->ErrorInfo;
    } 
    else {
        echo "<script language='javascript'>";
        echo "alert('Message sent! We will be in contact with you shortly.');";
        echo "window.location='http://www.littlelights.tk'";
        echo "</script>";
    }
        }
    ?>
    <title>Little Lights Daycare - Contact</title>
</head>
<body>
    <?php include "header.php"; ?>
    <div class="content">
        <div class="content-sub">
            <div class="contact-text">
                Please use this form to contact Teresa.
            </div>
            <form method="post" action="contact.htm" id="contact-form" name="contact-form">
                <table class="contact-table">
                    <tr>
                        <td>
                            Name:
                        </td>
                        <td>
                            <input type="text" name="name" id="name" size="30" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Email:
                        </td>
                        <td>
                            <input type="text" name="email" id="email" size="30" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Phone:
                        </td>
                        <td>
                            <!--(<input type="text" name="name" id="name" size="3" />)
                            -
                            <input type="text" name="name" id="name" size="3" />
                            -
                            <input type="text" name="name" id="name" size="3" />-->
                            <input type="text" name="name" id="name" size="30" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Subject:
                        </td>
                        <td>
                            <input type="text" name="subject" id="subject" size="30" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Question/Comment:
                        </td>
                        <td>
                            <textarea name="message" id="message" rows="7" cols="50" ></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="submit" value="Submit" name="submit" id="submit"/>
                            <br />
                            <br />
                            Contact information:
                            <br />
                            Phone: (717).290.1591
                            <br />
                            Email: jeremias2911@comcast.net
                            <br />
                            722 Catherine St.
                            <br />
                            Lancaster, PA 17603
                        </td>
                    </tr>
                </table> 
            </form>
        </div>
        <?php include "footer.php" ?>
    </div>
</body>
</html>

The message sends fine... But the contents look like this:
From: 811
Email: dilly@gmail.com
Phone:
Message:
Hey! Man whats up?

Where the input values were 'Dilly' for the name, '811' for the phone number, 'dilly@gmail.com'... the message is correct. Any suggestions please? Thank you in advance.

Edited by PhilEaton

1
Contributor
1
Reply
3
Views
4 Years
Discussion Span
Last Post by PhilEaton
0

Got it taken care of! The phone input had name 'name' :) Silly me!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.