Advice on fix - php contact form

Discussion in 'PHP' started by comcenter, Jul 27, 2007.

  1. #1
    Hi;

    I am trying to make a php contact form running from within a gamescript. The code for the form:

    <blockquote><strong>Submit Partner Link Application:</strong></blockquote>
    <table width=55%>
    <form action="/?page=partner" method="post">
    <tr>
    <td> Anchor : </td>
    <td><input type="text" name="name"/></td>
    </tr>
    <tr>
    <td>Link (with http://) : </td>
    <td><input type="text" name="link" /></td>
    </tr>
    <tr>
    <td>Email : </td>
    <td><input type="text" name="email" /></td>
    </tr>
    <tr>
    <td></td>
    <td><input alt="Send" type="image" class="btn" name="Submit" src="templates/images/btnsend.png" />
    </form>
    </td>
    </tr>
    </table>
    </div>


    The send mail script:

    <?
    $from = "From: Free Flash Games <support@freeflashgames.us>";
    $to = "ComCenter <sales@comcenter.org>";
    $subject = "Hi! ";
    $body = "TEST";

    if(mail($to,$subject,$body,$from)) echo "MAIL - OK";
    else echo "MAIL FAILED";
    ?>


    The form finds the partner.php, but nothing happens. How do I return the form values into the email?
    Any tips are welcome, I'm stuck, need a little push to keep going.

    Thanks.
     
    comcenter, Jul 27, 2007 IP
  2. pruad

    pruad Peon

    Messages:
    71
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Is "MAIL - OK" or "MAIL FAILED" printed?
     
    pruad, Jul 27, 2007 IP
  3. comcenter

    comcenter Well-Known Member

    Messages:
    706
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    130
    #3
    When I use the 'Send Mail' script by itself, MAIL OK is printed.

    But when 'Submiting' the form, nothing is printed at all (you can see for yourself here). This is the form. The only reason I still have 'TEST' as the body is because I wanted the script to return a value, then I could take it from there.
     
    comcenter, Jul 27, 2007 IP
  4. pruad

    pruad Peon

    Messages:
    71
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Maybe action="/?page=partner" doesn't point to the send mail script?

    Try replace ALL send mail script replace with testing point:

    <?php 
    print "Action is OK";
    ?>
    Code (markup):
    So you'll be sure where problem is.
     
    pruad, Jul 27, 2007 IP
  5. comcenter

    comcenter Well-Known Member

    Messages:
    706
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    130
    #5
    comcenter, Jul 27, 2007 IP
  6. pruad

    pruad Peon

    Messages:
    71
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Then try insert in html:

    
    <form action="/partner.php" method="post">
    
    HTML:
    /partner.php must be path to script
     
    pruad, Jul 27, 2007 IP
    comcenter likes this.
  7. comcenter

    comcenter Well-Known Member

    Messages:
    706
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    130
    #7
    Excellent!

    Submission button works, I hope you realize the size of headache I've had over this.

    Thanks.
     
    comcenter, Jul 27, 2007 IP
  8. pruad

    pruad Peon

    Messages:
    71
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Welcome =)
     
    pruad, Jul 27, 2007 IP