t3l Posted December 10, 2008 Share Posted December 10, 2008 Hi there. I'm here cuz I need some help. I made a feeback form that should send entered info to my email - i get the email but it fields are blank. It says Name Email Subscribe Unsubscribe Feedback But it doesn't write down what I filled in. Which is pretty useless for a form I must say! Any ideas appreciated. Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/ Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 Umm post the code and we can sure help. Remember to use the [ code ] [ /code ] tags. Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-710955 Share on other sites More sharing options...
t3l Posted December 10, 2008 Author Share Posted December 10, 2008 <?php /* subject and email variables */ $emailSubject = 'Feedback from Telemika.com'; $webMaster = 'photo@gmail.com'; /* Gathering Data Variables */ $emailField = $_POST['email']; $subscribeField = $_POST['subscribe']; $unsubscribeField = $_POST['unsubscribe']; $nameField = $_POST['name']; $feedbackField = $_POST['feedback']; $body = <<<EOD <br><hr><br> Email: $email <br> Name: $name <br> Subscribe: $subscribe <br> Unsubscribe: $unsubscribe <br> Feedback: $feedback <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Thanks!</title> <style type="text/css"> <!-- body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #666666; margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ padding: 0; text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ color: #000000; background-color: #000000; } .contact { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #484848; text-decoration: none; font-weight: normal; letter-spacing: 1px; } .art { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FF3399; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .artroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .multimedia { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #9933FF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .multimediaroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .work { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #00CC00; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .workroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .news { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFF00; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .newsroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .bio { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FF3300; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .bioroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .shop { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #00CCFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .shoproll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .oneColFixCtrHdr #container { width: 960px; margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */ border: 1px solid #000000; text-align: left; /* this overrides the text-align: center on the body element. */ } a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } .newstext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFF00; text-decoration: none; letter-spacing: 1px; padding-top: 2px; padding-right: 5px; padding-bottom: 5px; padding-left: 10px; border-top-color: #A6A6A6; } .newsframe { border: 1px dotted #00CC00; } .worktext {color: #009933} .style1 {color: #009933; font-weight: bold; } .style3 {color: #009933; font-size: 12px; } --> </style> </head> <body class="oneColFixCtrHdr"> <div id="container"> <div id="header"> <table width="718" height="580" align="center"> <tr> <td width="710" height="14"><div align="center" class="contact"> <p><a href="mailto:photo@gmail.com" class="contact">Telephoto | Photography & Multimedia | photo@gmail.com | +44(0)12345678</a></p> </div></td> </tr> <tr> <td height="33"><table width="706" height="27" border="0" align="center" bgcolor="#000000" class="menu"> <tr> <td width="107" height="23" class="art"><div align="center" class="art"><a href="art.html" class="art">Art</a></div></td> <td width="139" height="23" class="work"><div align="center" class="multimedia"><a href="multimedia.html" class="multimedia">Multimedia</a></div></td> <td width="122" height="23" class="news"><div align="center" class="work"><a href="work.html" class="work">Work</a></div></td> <td width="116" height="23" class="shop"><div align="center" class="news"><a href="news.html" class="news">News</a></div></td> <td width="98" height="23" class="bio"><div align="center" class="bio"><a href="bio.html" class="bio">Bio</a></div></td> <td width="98" class="bio"><div align="center" class="shop"><a href="shop.html" class="shop">Shop</a></div></td> </tr> </table></td> </tr> <tr> <td height="21"><div align="center"> <table width="720" height="503" border="0" class="newsframe"> <tr> <td valign="top" class="newstext"><p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center" class="style1"> </p> <p align="center" class="style3">Success!</p> <p align="center" class="style3">You request has been sent.</p> <p align="center" class="style3">Thanks for your interest!</p> <p align="center"> </p> <p align="center" class="worktext"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center" class="worktext"> </p> <p align="center"> </p></td> </tr> </table> </div></td> </tr> </table> </div> <!-- end #container --> </body> </html> </tr> <div id="footer"> <table width="718" height="23" align="center"> <tr> <td width="710" height="14"><div align="center" class="contact"> <p><a href="feedback.html" class="contact" target="_blank">-Subscribe | Feedback-</a></p> </div></td> </div> </body> </html> EOD; echo "$theResults"; ?> (the tags are not [ code ][ /code ] -- ken) Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-710960 Share on other sites More sharing options...
gevans Posted December 10, 2008 Share Posted December 10, 2008 $body = "\n<hr>\n Email: $email \n Name: $name \n Subscribe: $subscribe \n Unsubscribe: $unsubscribe \n Feedback: $feedback \n"; Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-710967 Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 The reason we use the [ code ] [ /code ] tags is that we do not have to scroll forever just to look at the code. Please do this from now on. <?php /* subject and email variables */ $emailSubject = 'Feedback from Telemika.com'; $webMaster = 'erikaphoto@gmail.com'; /* Gathering Data Variables */ $emailField = $_POST['email']; $subscribeField = $_POST['subscribe']; $unsubscribeField = $_POST['unsubscribe']; $nameField = $_POST['name']; $feedbackField = $_POST['feedback']; $body = <<<EOD <br><hr><br> Email: $email <br> Name: $name <br> Subscribe: $subscribe <br> Unsubscribe: $unsubscribe <br> Feedback: $feedback <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Thanks!</title> <style type="text/css"> <!-- body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #666666; margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ padding: 0; text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ color: #000000; background-color: #000000; } .contact { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #484848; text-decoration: none; font-weight: normal; letter-spacing: 1px; } .art { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FF3399; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .artroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .multimedia { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #9933FF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .multimediaroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .work { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #00CC00; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .workroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .news { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFF00; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .newsroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .bio { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FF3300; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .bioroll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .shop { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #00CCFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .shoproll { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none; font-weight: bold; letter-spacing: 1px; padding-bottom: 5px; } .oneColFixCtrHdr #container { width: 960px; margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */ border: 1px solid #000000; text-align: left; /* this overrides the text-align: center on the body element. */ } a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } .newstext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFF00; text-decoration: none; letter-spacing: 1px; padding-top: 2px; padding-right: 5px; padding-bottom: 5px; padding-left: 10px; border-top-color: #A6A6A6; } .newsframe { border: 1px dotted #00CC00; } .worktext {color: #009933} .style1 {color: #009933; font-weight: bold; } .style3 {color: #009933; font-size: 12px; } --> </style> </head> <body class="oneColFixCtrHdr"> <div id="container"> <div id="header"> <table width="718" height="580" align="center"> <tr> <td width="710" height="14"><div align="center" class="contact"> <p><a href="mailto:erikaphoto@gmail.com" class="contact">Erika T. Bergère | Photography & Multimedia | erikaphoto@gmail.com | +44(0)7910122945</a></p> </div></td> </tr> <tr> <td height="33"><table width="706" height="27" border="0" align="center" bgcolor="#000000" class="menu"> <tr> <td width="107" height="23" class="art"><div align="center" class="art"><a href="art.html" class="art">Art</a></div></td> <td width="139" height="23" class="work"><div align="center" class="multimedia"><a href="multimedia.html" class="multimedia">Multimedia</a></div></td> <td width="122" height="23" class="news"><div align="center" class="work"><a href="work.html" class="work">Work</a></div></td> <td width="116" height="23" class="shop"><div align="center" class="news"><a href="news.html" class="news">News</a></div></td> <td width="98" height="23" class="bio"><div align="center" class="bio"><a href="bio.html" class="bio">Bio</a></div></td> <td width="98" class="bio"><div align="center" class="shop"><a href="shop.html" class="shop">Shop</a></div></td> </tr> </table></td> </tr> <tr> <td height="21"><div align="center"> <table width="720" height="503" border="0" class="newsframe"> <tr> <td valign="top" class="newstext"><p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center" class="style1"> </p> <p align="center" class="style3">Success!</p> <p align="center" class="style3">You request has been sent.</p> <p align="center" class="style3">Thanks for your interest!</p> <p align="center"> </p> <p align="center" class="worktext"> </p> <p align="center"> </p> <p align="center"> </p> <p align="center" class="worktext"> </p> <p align="center"> </p></td> </tr> </table> </div></td> </tr> </table> </div> <!-- end #container --> </body> </html> </tr> <div id="footer"> <table width="718" height="23" align="center"> <tr> <td width="710" height="14"><div align="center" class="contact"> <p><a href="feedback.html" class="contact" target="_blank">-Subscribe | Feedback-</a></p> </div></td> </div> </body> </html> EOD; echo "$theResults"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-710968 Share on other sites More sharing options...
t3l Posted December 10, 2008 Author Share Posted December 10, 2008 So sorry, I just tried to modify i with the tags but it didn't work. I just put it before and after right? Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-710976 Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 You have to remove the spaces in the tag, since it parses them I had to space them out. Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-710978 Share on other sites More sharing options...
t3l Posted December 10, 2008 Author Share Posted December 10, 2008 You have to remove the spaces in the tag, since it parses them I had to space them out. ok thanks. i can't modify it now though?? Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-710988 Share on other sites More sharing options...
t3l Posted December 10, 2008 Author Share Posted December 10, 2008 $body = "\n<hr>\n Email: $email \n Name: $name \n Subscribe: $subscribe \n Unsubscribe: $unsubscribe \n Feedback: $feedback \n"; thanks gevans. I just replaced that section with the above but it's still empty. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-710989 Share on other sites More sharing options...
gevans Posted December 10, 2008 Share Posted December 10, 2008 I just realized you haven't got the post variables that the form sent look at premiso' form!! Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-711002 Share on other sites More sharing options...
t3l Posted December 10, 2008 Author Share Posted December 10, 2008 sorry i don't see the difference... Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-711011 Share on other sites More sharing options...
gevans Posted December 10, 2008 Share Posted December 10, 2008 seeing the difference isn't a huge issue, lol I'd suggest trying his code and if it works then trying to spot the difference! Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-711013 Share on other sites More sharing options...
gevans Posted December 10, 2008 Share Posted December 10, 2008 And if you still can't figure it out add this; $emailField = $_POST['email']; $subscribeField = $_POST['subscribe']; $unsubscribeField = $_POST['unsubscribe']; $nameField = $_POST['name']; $feedbackField = $_POST['feedback']; before the code I gave you first of all! Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-711016 Share on other sites More sharing options...
t3l Posted December 10, 2008 Author Share Posted December 10, 2008 Thank you. I replaced the entire thing with premiso's code but the data fields were still blank. So I tried adding the above piece of code and the one you gave me before but I'm still getting blank emails... Does it have something to do with spry verification (which I have not done)? Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-711034 Share on other sites More sharing options...
t3l Posted December 10, 2008 Author Share Posted December 10, 2008 Hi I'm really sorry but I've just followed two video tutorials - one on how to set up a form and the other on how to write the PHP script and I just don't get why my forms sending me blank information still!! Quote Link to comment https://forums.phpfreaks.com/topic/136283-empty-forms/#findComment-712080 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.