Formmail PHP Scripts Ignoring the Hidden Fields in HTML?

Discussion in 'PHP' started by sixty6, Jul 12, 2008.

  1. #1
    I've setup Formmail scripts before, but in this case, the PHP Script is just ignoring the <input type="hidden"...> fields in the form.

    You can view the form at:
    http://www.peapodarcade.com/index.php?view=Sponsor_a_Page

    and I've attached the EXACT php script.

    The form submits itself correctly, even though it is supposed to check it's 'required' fields. In this case, I want it to check the email field, and even when the email field is empty, it still submits the form...

    If anyone can help, I would truly appreciate it!!
     

    Attached Files:

    sixty6, Jul 12, 2008 IP
  2. jdseo

    jdseo Peon

    Messages:
    9
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you PM me with all the details I'm more than happy to code you a new form.
     
    jdseo, Jul 13, 2008 IP
    sixty6 likes this.
  3. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #3
    I haven't looked into your code, but the way your phrased your post it relies upon the content on HTML input elements to verify it?

    Sounds a bit of an iffy way if you ask me....

    Dan
     
    Danltn, Jul 13, 2008 IP
  4. sixty6

    sixty6 Well-Known Member

    Messages:
    1,748
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    190
    #4
    From my understanding, the HTML form is supposed to have hidden elements that are submitted by the form to the formmail script. The formmail PHP script (seen above) then processes this and is supposed to:
    1. Check if missing fields are present and STOP the form and inform the user.
    2. Submit the form

    But it submits, even if the required fields are submitted or not...which is my problem, where I'm looking for work...
     
    sixty6, Jul 13, 2008 IP
  5. clarky_y2k3

    clarky_y2k3 Well-Known Member

    Messages:
    114
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    108
    #5
    Could you post the contents of the file please? I can't view the attachment because the attachmentviews table here has been marked as crashed.
     
    clarky_y2k3, Jul 13, 2008 IP
  6. sixty6

    sixty6 Well-Known Member

    Messages:
    1,748
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    190
    #6
    Thanks for all the offers to help, I've got meetings until 7pm, but I will post up the HTML page (the page with the form) and the PHP page (the formmail script processing the form) by 7:30 pm.
     
    sixty6, Jul 13, 2008 IP
  7. sixty6

    sixty6 Well-Known Member

    Messages:
    1,748
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    190
    #7
    Alright, here are the two files (got held up with some unscheduled stuff). If anyone can help, I'd appreciate it!
     

    Attached Files:

    sixty6, Jul 13, 2008 IP
  8. sixty6

    sixty6 Well-Known Member

    Messages:
    1,748
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    190
    #8
    Got it resolved with another mailing script on suggestion of jdseo:
    http://formtoemail.com/

    Now here is what I did...

    FormToEmail didn't check for specific fields to see if they were filled in, which was my primary problem, but they checked if at least ONE field was filled in (so I wouldn't get a blank form...kinda idiotic)

    but I just put this code after line 145 (common sense after looking at the code):
    Whatever is in the ' ' should be the HTML field name and then the " " should contain the error message.

    You can check the new form here and test out the errors if you want:
    http://www.peapodarcade.com/index.php?view=Sponsor_a_Page
     
    sixty6, Jul 14, 2008 IP