Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Oct 2012
    Location
    Brisbane QLD Australia
    Posts
    12
    Member #
    33227
    Hi I have a php script and an html form:

    bellow is the code for both HTML first then the PHP.
    The problem is when I press send from here: http://aussiemines.com/spa/contact.php
    It send's the name field, the email field, the subject field but no the Message field.

    So I am asking for some help.

    HTML:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="contactstyle.css" rel="stylesheet" type="text/css">
    <title>Shutter Speed Artography - Contact</title>
    
    <style type="text/css">
    p.c3 {text-align:center;}
    p.c2 {color: #00CC00; text-align:center;}
    h1.c1 {text-align:left; text-indent:10%; color: #FFFFFF; text-decoration:underline;}
    </style>
    </head>
    <body>
    <div id='cssmenu'>
    <ul>
    <li class='active'><a href='index.html'><span>Home</span></a></li>
    <li><a href='products.html'><span>Products</span></a></li>
    <li><a href='gallery.html'><span>Gallery</span></a></li>
    <li><a href='about.html'><span>About</span></a></li>
    <li><a href='contact.php'><span>Contact</span></a></li>
    <li><a href='info.html'><span>info</span></a></li>
    </ul>
    </div>
    <br>
    <br>
    <h1 class="c1">Contact Us</h1>
    <div class="wrapper"><br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <div id="contact-page">
    <p>To contact Shutter Speed Artography please fill in the form bellow and a member from the team will respond to your message.</p>
    <br>
    <br>
    <form action="contactmail.php" method="post">
    <div class="box">
    <h1>Contact Form :</h1>
    <label> <span>Full name</span> <input type="text" class="input_text" name="name" id="name"> </label> <label> <span>Email</span> <input type="text" class="input_text" name="email" id="email"> </label> <label> <span>Subject</span> <input type="text" class="input_text" name="subject" id="subject"> </label> <label> <span>Message</span>
    <textarea class="message" name="message" id="message">
    </textarea>
    <input type="submit" class="button" value="send"> </label> </div>
    </form>
    <div class="push"></div>
    </div>
    </div>
    <div class="footer">
    <p>Copyright  2012 Shutter Speed Artography.</p>
    <p>Created and updated by: Nicholas Sansom</p>
    </div>
    </body>
    </html>
    PHP:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
    <title></title>
    
    <style type="text/css">
    a.c1 {text-decoration:none;color:#ff0099;}
    </style>
    </head>
    <body>
    Thank You! Your Email has been recievied.<br>
    We are currently reviewing your email and will get back to you.<br>
    Thanks for using the Shutter Speed Artography Network.<br>
    <br>
    - <a href='http://aussiemines.com/spa/index.html' class='c1'>Return to Shutter Speed Artography</a>
    
    <?php
    $name= $_POST['name'];
    $email = $_POST['email'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    $formcontent="
    From: $name \n email: $email \n subject: $subject \n message: $messgae ";
    $recipient = "aussiemines@gmail.com";
    $subject = "Shutter Speed Artography - Contact Form";
    $mailheader = "From: $email \r\n";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
    
    ?>
    
    </body>
    </html>
    Thanks everyone.
    I am gratful for all the help and support I recieve.

    Nicholas Sansom

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    Check spelling:
    From: $name \n email: $email \n subject: $subject \n message: $messgae ";

    You may also want to force the PHP to finish the mail() function before
    halting or moving on ... PHP will stay with the "if" statement until it
    either gets a TRUE or FALSE. So it has to perform the function before
    moving on. This can fix time-out issues that sometimes occur.

    Change:
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

    To:
    if(mail($recipient, $subject, $formcontent, $mailheader)){
    // sent OK
    }
    else{
    echo "mail did not send for some reason.";
    }

    More spelling problems:

    To contact Shutter Speed Artography please fill in the form bellow and a member from the team will respond to your message.

    Vaild .... spelled wrong in a couple of places.

    Another comment ...
    I'm not sure where W3C is at pertaining to HTML5 Doctype: <!DOCTYPE html>
    No need to concern yourself with specific doctypes if you use HTML5.
    Example, you're using: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    You may want to simplify things by using <!DOCTYPE html>

    I think W3C is going to come up with an HTML5 validation ?? Anyone know the future of that?

    no big deal, just an observation. look into HTML5 if you wish to learn more about it.


  4. #3
    Junior Member
    Join Date
    Oct 2012
    Location
    Brisbane QLD Australia
    Posts
    12
    Member #
    33227
    Thanks mlseim for the assistance. I have fixed the errors (spelling) and script.
    all works now. thanks.

    Also in regards to:
    You may want to simplify things by using <!DOCTYPE html>

    I think W3C is going to come up with an HTML5 validation ?? Anyone know the future of that?

    no big deal, just an observation. look into HTML5 if you wish to learn more about it.
    W3 will be adding a verify system eventually. At the moment if you try to Vaildate:
    HTML Code:
    <!DOCTYPE html>
    It says that is an experiment. I did some reasearch and everyone said Just use the HTML 4.01

    Thanks again.

    Nicholas Sansom

  5. #4
    Eis
    Eis is offline
    Junior Member Eis's Avatar
    Join Date
    Feb 2012
    Posts
    12
    Member #
    30892
    Liked
    2 times
    I think W3C is going to come up with an HTML5 validation ?? Anyone know the future of that?
    I thought they had a Beta HTML5 Validation? So I guess they are working on it.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:37 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com