Quality stock photos for your creative or marketing needs. Photolibrary - We Get It


Graphic Design Forums: UK forums for graphic designers » Website Design Forums: » Website Coding & Programming Forum: » PHP Form Handling Script (Submitting Dreamweaver Forms)

Reply
Old 07-21-2009, 05:27 PM   #1
Senior Member
 
sweetums's Avatar
 
Join Date: Jun 2008
Location: Bristol (UK)
Posts: 142
Thanks: 15
Thanked 15 Times in 12 Posts
Send a message via MSN to sweetums Send a message via Skype™ to sweetums
Default 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.

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
sweetums is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 07-26-2009, 08:03 AM   #2
Junior Member
 
OliverB's Avatar
 
Join Date: May 2009
Posts: 22
Thanks: 6
Thanked 1 Time in 1 Post
Default

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.
OliverB is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 07-26-2009, 11:21 AM   #3
Senior Member
 
sweetums's Avatar
 
Join Date: Jun 2008
Location: Bristol (UK)
Posts: 142
Thanks: 15
Thanked 15 Times in 12 Posts
Send a message via MSN to sweetums Send a message via Skype™ to sweetums
Default

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
sweetums is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 07-26-2009, 06:46 PM   #4
Junior Member
 
OliverB's Avatar
 
Join Date: May 2009
Posts: 22
Thanks: 6
Thanked 1 Time in 1 Post
Default

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.
OliverB is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
The Following User Says Thank You to OliverB For This Useful Post:
sweetums (07-26-2009)
Old 07-26-2009, 08:06 PM   #5
Senior Member
 
sweetums's Avatar
 
Join Date: Jun 2008
Location: Bristol (UK)
Posts: 142
Thanks: 15
Thanked 15 Times in 12 Posts
Send a message via MSN to sweetums Send a message via Skype™ to sweetums
Default

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
sweetums is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 07-27-2009, 11:16 AM   #6
Senior Member
 
Join Date: Mar 2009
Location: Hampshire
Posts: 164
Thanks: 4
Thanked 13 Times in 13 Posts
Default

Hope you are sanitizing those form variables!! Otherwise it's a world of hurt!
KevJaques is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 07-28-2009, 12:31 PM   #7
Senior Member
 
sweetums's Avatar
 
Join Date: Jun 2008
Location: Bristol (UK)
Posts: 142
Thanks: 15
Thanked 15 Times in 12 Posts
Send a message via MSN to sweetums Send a message via Skype™ to sweetums
Default

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
sweetums is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 07-28-2009, 04:51 PM   #8
Junior Member
 
OliverB's Avatar
 
Join Date: May 2009
Posts: 22
Thanks: 6
Thanked 1 Time in 1 Post
Default

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.
OliverB is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 07-29-2009, 11:50 AM   #9
Senior Member
 
sweetums's Avatar
 
Join Date: Jun 2008
Location: Bristol (UK)
Posts: 142
Thanks: 15
Thanked 15 Times in 12 Posts
Send a message via MSN to sweetums Send a message via Skype™ to sweetums
Default

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
sweetums is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Reply

Tags
dreamweaver, forms

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Flyer Printing | Print Reseller Scheme | Graphic Design | Logo Designer | Web Design UK | Graphic Design UK | Letterhead Printing
Business Card Printing | UK Business Forum | Logo Designer | NCR Pads | NCR Books | Receipt Books | Drinks Coasters | A6 Flyers | A5 Leaflets
Web Design & Development | vBulletin Skins | Small Business Websites | Leaflets | Leaflet Printing | Web Design Liverpool | Invoice Books


DISCLAIMER: All posts on this forum express the views and opinions of the author only, not the owners, staff or advertisers, hence we will not be held liable.


Powered by vBulletin®
© Copyright Jelsoft Enterprises Ltd
SEO by vBSEO 3.2.0 RC5 ©2008, Crawlability, Inc.