Results 1 to 9 of 9
  1. #1
    Senior Member sweetums's Avatar
    Join Date
    Jun 2008
    Location
    Bristol (UK)
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP Form Handling Script (Submitting Dreamweaver Forms)

    I need to learn how to make forms that I create in Dreamweaver actually do something,
    so I've been watching a video on how to create PHP Form Handling Script. I've been through
    the video about 3 times and triple checked my code to make sure its the same as in the video
    but when I click submit on my created form I just get a blank page with no confirmation message
    and I never receive an email despite trying it with several different emails. :icon_Wall:

    So does anyone have any ideas about what I might be doing wrong or any suggestions
    on any other resources that I can use to learn about linking forms?

    Any help would be much appreciated as always!
    Twitter: liamjay66

    Website: liamjaydesigns.com

  2. #2
    Junior Member OliverB's Avatar
    Join Date
    May 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    The form does work, I followed this tutorial a few months ago. If you want me to have a look at it then post your php code on here.

    But if it's just the blank confirmation page make sure that you have the doc type included.

  3. #3
    Senior Member sweetums's Avatar
    Join Date
    Jun 2008
    Location
    Bristol (UK)
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the answer Oliver,

    I know the form should work which is why I can't understand why mine does not.
    I've got the doc type included in the part that needs to be rendered in html so don't know what it wrong.
    I've created a .zip file of the entire root folder so you can check all of the stuff that I've done and see
    if you can work out what I've done wrong! test.zip
    Twitter: liamjay66

    Website: liamjaydesigns.com

  4. #4
    Junior Member OliverB's Avatar
    Join Date
    May 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok I've had a look at your php script. What you need to do is this:

    This section below is wrong. They are not all called 'emailField'. They are called whatever you have called them in the HTML page.

    $emailField = $_POST['email'];
    $emailField = $_POST['name'];
    $emailField = $_POST['phone'];
    $emailField = $_POST['budget'];
    etc..

    So it should be

    $emailField = $_POST['email'];
    $nameField = $_POST['name'];
    $phoneField = $_POST['phone'];
    $budgetField = $_POST['budget'];
    etc...

    The next section is correct but you have missed out some '$'...it needs to be exactly the same as above.

    Also you need to copy the whole code for your 'thank you' page. So go to code view of your 'thank you' page, select all the code and copy. Paste this between
    $theResults = <<<EOD
    PASTE HERE.
    EOD;
    echo "$theResults";
    ?>

    ....and that should work. If you preview your page and submit, the page will either display your 'thank you' page or the php code itself. Either way this will work when properly uploaded to the net.

    Hope this helps.

  5. #5
    Senior Member sweetums's Avatar
    Join Date
    Jun 2008
    Location
    Bristol (UK)
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cheers for taking the time to have a look at my script,

    I've made all the corrections and made sure I've got all the code from the thank
    you page and when preview it and click submit it has now progressed from being
    a blank page to one that has all of the php code showing BUT when I upload it to
    my FTP site and test it I just reveive a blank page when I click submit. Could this
    be something to do with my web hoster or have I done something wrong.
    Again I've created a zip of all my pages here
    Twitter: liamjay66

    Website: liamjaydesigns.com

  6. #6
    Senior Member
    Join Date
    Mar 2009
    Location
    Hampshire
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hope you are sanitizing those form variables!! Otherwise it's a world of hurt!

  7. #7
    Senior Member sweetums's Avatar
    Join Date
    Jun 2008
    Location
    Bristol (UK)
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well this is the first time I've ever done any PHP scripting so all I did was follow
    the tutorial that I linked to in my original post so I only know whats in that tutorial!
    What I need to be able to do is make my forms that I create in Dreamweaver
    actually do something when the submit button is pressed but I can't understand why
    the pages I create from the tutorial don't work
    Twitter: liamjay66

    Website: liamjaydesigns.com

  8. #8
    Junior Member OliverB's Avatar
    Join Date
    May 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    You have to upload everything. So you have to upload the page with the form on and the thank you page as well.

    Also on the html page with the form, do you have it linked to the php page? ie when you click on the form area (should be a red dotted line), in the properties bar there should be a field call 'actions'...you need to put your php file here. Also method should be 'post'.

    I really can't think of anything else really, just 100% check your code and where you want the email to go. I sent my script to your email, so you could just edit that. If i have any time i will take another look at you code.

    Hope this helps.

  9. #9
    Senior Member sweetums's Avatar
    Join Date
    Jun 2008
    Location
    Bristol (UK)
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes I have uploaded the whole "test" folder which contained all the pages that I created
    and I've checked the form area and I did have it linked to the php page with the method
    being set to "post" as you suggested it should be.
    I'll go through my code again as I can't think of what else could be wrong.
    Thanks for taking the time to respond though as you have been very helpful :)
    Twitter: liamjay66

    Website: liamjaydesigns.com

Similar Threads

  1. Sorry, Newbie Question about forms
    By den in forum Website Coding & Programming Forum:
    Replies: 2
    Last Post: 10-07-2011, 07:58 AM
  2. Gravity Forms plugin - Wordpress
    By sweetums in forum Website Coding & Programming Forum:
    Replies: 0
    Last Post: 04-29-2010, 10:14 AM
  3. Submitting website to Tiscali
    By frogger2779 in forum SEO & Online Marketing Forum:
    Replies: 0
    Last Post: 07-18-2009, 02:01 PM
  4. Order forms... How do you do yours?
    By GingerChris in forum Website Coding & Programming Forum:
    Replies: 30
    Last Post: 01-22-2009, 04:49 PM
  5. freelance business forms
    By freshinkdesign in forum General Business Forum:
    Replies: 2
    Last Post: 08-08-2008, 10:46 PM

Tags for this Thread

Posting Permissions

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