Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default Contact Box not working (.PHP) Help!

    Im using this code to get my contact box to sent the message to my email, but when i click send it just delets the text i put in the boxes and doesn't sent the message to my email or redirect to the confirming the message has been sent page if you get what i mean.

    Code:
    <?php
    
    
    /* Email Variables */
    $emailSubject = 'contact!'; /*Make sure this matches the name of your file*/
    $webMaster = '[email protected]';
    
    /* Data Variables */
    $name = $_POST['your_name'];
    $email = $_POST['you_email'];
    $message = $_POST['your_enquiry'];
    
    
    
    $body = <<<EOD
    <br><hr><br>
    Name: $name <br>
    Email: $email <br>
    Comments: $comments <br>
    EOD;
    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body,
    $headers);
    
    
    /* Results rendered as HTML */
    $theResults = <<<EOD
    <html>
    <head>
    <title>sent message</title>
    <meta http-equiv="refresh" content="3;URL=http://www.cheapgp.net/index.html">
    <style type="text/css">
    <!--
    body {
    background-color: #444; /* You can edit this CSS to match your website*/
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    color: #fec001;
    text-decoration: none;
    padding-top: 200px;
    margin-left: 150px;
    width: 800px;
    }
    -->
    </style>
    </head>
    <div align="center">The message has been successfully sent.</div>
    </div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    ?>
    This is the contact me box im using:

    Code:
    <h1>Contact Us        </h1>
            <form action="contact.php" method="post">
              <div class="form_settings">
                <p><span>Name</span><input class="contact" type="text" name="your_name" value="" /></p>
                <p><span>Email Address</span><input class="contact" type="text" name="your_email" value="" /></p>
                <p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="your_enquiry"></textarea></p>
                <p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p>
    Any ideas?

  2. #2
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default

    worked it out after 2 hours of redoing the whole page, it has so many errors

  3. #3
    Join Date
    Jan 2010
    Location
    Scotland
    Posts
    3,641
    Tokens
    4,896
    Habbo
    Mark

    Latest Awards:

    Default

    Glad you got there in the end

  4. #4
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default

    Quote Originally Posted by markypee4 View Post
    Glad you got there in the end
    ty considering im only 13 i think my coding isn't to bad, but i do make mistakes here and there.

  5. #5
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by Bot View Post
    ty considering im only 13 i think my coding isn't to bad, but i do make mistakes here and there.
    Age is unimportant, I've met 11 and 12 year olds who have insane PHP and Java skills.

  6. #6
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default

    Quote Originally Posted by Trinity View Post
    Age is unimportant, I've met 11 and 12 year olds who have insane PHP and Java skills.
    i only got dreamweaver on saturday, well i'm pleased with what i know

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •