SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    SitePoint Addict
    Join Date
    Nov 2012
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why doesn't my form work ?

    Well it works partially in that the form comes through, but the form is always blank. What have I done wrong.

    Extract from HTML

    HTML Code:
    <ul class="opendays">
     <li>
     <p><strong>Change of Peronal Details</strong></p>
     </li>
     </ul>
    
    
    
    
            <form action="send_contact.php" method="post">
            <ul class="opendays">
        
                      <li> <p>Your Name <required>*</required></p><p><input type="text"></p></li>
                        
                      <li><p>Your Email <required>*</required></p><p><input type="text"></p></li>
                        
                      <li><p>With Effect From <required>*</required></p><p><input type="text"></p></li>
                      
                      <li><p>Telephone No </p><p><input type="text"></p></li>
                                            
                      <li><p>Mobile Number </p><p><input type="text"></p></li>
                      
                      <li><p>Adress Line 1 </p><p><input type="text"></p></li>
                      
                      <li><p>Adress Line 2 </p><p><input type="text"></p></li>
                      
                      <li><p>Adress Line 3 </p><p><input type="text"></p></li>
                      
                      <li><p>Adress Line 4 </p><p><input type="text"></p></li>
                      
                      <li><p>Adress Line 5 </p><p><input type="text"></p></li>
                
                      <li><p>&nbsp</p><p><button type="submit" class="button">Submit</button></p></li>
                      </ul>
                      <br> <required> * (indicates that the information is required)
                                    </form>
    Extract from PHP

    PHP Code:
    <?php

    // Contact subject
     
    $subject ="$Contact Form"

    // Details
     
    $message="$detail"


    // Mail of sender
     
    $mail_from="$customer_mail"

    // From 
    $header="from: $detail <$mail_from>"


    // Enter your email address
     
    $to ='antonylambert@c5d.co.uk'

    $send_contact=mail($to,$subject,$message,$header);


     
    // Check, if message sent to your email 
    // display message "We've recived your information"
     
    if($send_contact){
     echo 
    "Thanks for sending this change of details. I shall update our records right away.";
     }
     else {
     echo 
    "ERROR";
     }
     
    ?>
    Please answer in words of one syllable please

    Antony
    Last edited by SpacePhoenix; Feb 8, 2013 at 16:35. Reason: placed php tags around php code


Bookmarks

Posting Permissions

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