1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Contact Form php

Discussion in 'PHP' started by DK-Tandy, May 25, 2015.

  1. #1
    i have a contact form but im a little bit stuck with the PHP behind the contact form..

    
    <form method="post" action="includes/email.php">
                     <div class="row uniform 50%">
                       <div class="6u 12u$(xsmall)">
                         <input type="text" name="name" id="name" value="" placeholder="Name" />
                       </div>
                       <div class="6u$ 12u$(xsmall)">
                         <input type="email" name="email" id="email" value="" placeholder="Email" />
                       </div>
                       <div class="12u$">
                         <div class="select-wrapper">
                           <select name="category" id="category">
                             <option value="">- Category -</option>
                             <option value="1">Website Bugs/Errors</option>
                             <option value="1">MyAdvertisingPays Queries </option>
                             <option value="1">Other</option>
                           </select>
                         </div>
                       </div>
                       <div class="4u 12u$(small)">
                         <input type="radio" id="priority-low" name="priority" checked>
                         <label for="priority-low">Low Priority</label>
                       </div>
                       <div class="4u 12u$(small)">
                         <input type="radio" id="priority-normal" name="priority">
                         <label for="priority-normal">Normal Priority</label>
                       </div>
                       <div class="4u$ 12u$(small)">
                         <input type="radio" id="priority-high" name="priority">
                         <label for="priority-high">High Priority</label>
                       </div>
                       <div class="6u 12u$(small)">
                         <input type="checkbox" id="copy" name="copy">
                         <label for="copy">Email me a copy of this message</label>
                       </div>
                       <div class="6u$ 12u$(small)">
                         <input type="checkbox" id="human" name="human" unchecked>
                         <label for="human">I am a human and not a robot</label>
                       </div>
                       <div class="12u$">
                         <textarea name="message" id="message" placeholder="Enter your message" rows="6"></textarea>
                       </div>
                       <div class="12u$">
                         <ul class="actions">
                           <li><input type="submit" value="Send Message" class="special" /></li>
                           <li><input type="reset" value="Reset" /></li>
                         </ul>
                       </div>
                     </div>
                   </form>
    
    Code (markup):
    thats the form im running, but i cant get it to send mails? i so have have a mailto in the emails.php file and some other stuff i just got rid as it gave me these errors


    Notice: Undefined index: Name in C:\xampp\htdocs\mmm\includes\email.php on line 2

    Notice: Undefined index: Email in C:\xampp\htdocs\mmm\includes\email.php on line 2

    Warning: mail() expects at most 5 parameters, 7 given in C:\xampp\htdocs\mmm\includes\email.php on line 2

    Your email has been sent.


    PHP aint my thing.. :(

    any help will be appreciated
     
    DK-Tandy, May 25, 2015 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Well, you should post the content of email.php - the form looks okay (apart from the horrible HTML and absurd classnames) - the problem lies in email.php, and from the looks of the errors, it seems you're using undeclared variables, or trying to use something with the wrong name.
     
    PoPSiCLe, May 25, 2015 IP
  3. DK-Tandy

    DK-Tandy Active Member

    Messages:
    330
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    because email.php was that poor i deleted it altogether.. so im basically starting from scratch again..
     
    DK-Tandy, May 25, 2015 IP
  4. SuperMechs

    SuperMechs Member

    Messages:
    44
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    35
    #4
    Then the error is clear. You're calling /email.php into the file, as you can see in the first few lines of your script, yet email.php no longer exists. That's why you're having problems.
     
    SuperMechs, May 25, 2015 IP
  5. DK-Tandy

    DK-Tandy Active Member

    Messages:
    330
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #5
    those were the errors i got while the email.php was there, it has since been deleted..
     
    DK-Tandy, May 25, 2015 IP
  6. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #6
    deathshadow is still thinking how to critique your html code...
     
    NetStar, May 25, 2015 IP
  7. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #7
    Then rewrite email.php, post the code here after testing, and we'll give you more help. We're not gonna write it for you.
     
    PoPSiCLe, May 26, 2015 IP
  8. digi_media

    digi_media Active Member

    Messages:
    99
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    68
    #8
    Try leaving the action field blank in line number 2.

    I am also new in PHP. But give a try...

    All the best.
     
    digi_media, May 27, 2015 IP