Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Contact form is being sent- blank!

    I created a pretty basic PHP form for my Dad's website, and it's working great. The only problem is that whenever someone sends in the form, 2 or three BLANK copies are sent after it.

    The only reason I can think of is because people are refreshing the process.php page. Is there a code I can use to make sure the form isn't sent to me blank all the time?

    Page with form:
    http://www.qualitygrainservices.com/other/contact.php

    Process Page:
    http://www.qualitygrainservices.com/other/process.php

    Thanks very much!
    -Kelsie

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    Before you process the form you can check if its empty or not, eg.

    PHP Code:
    if(!empty($_POST['form'])){
    // process the form
    }

    // OR

    if(strlen($_POST['form']) > 0){
    // process the form


  • #3
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Quote Originally Posted by Mwnciau
    Before you process the form you can check if its empty or not, eg.

    PHP Code:
    if(!empty($_POST['form'])){
    // process the form
    }

    // OR

    if(strlen($_POST['form']) > 0){
    // process the form
    }
    Or
    PHP Code:
    if(isset($_POST['submit']))
    {
    //process the form

    for that matter..

    Can we see your code?

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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