Angeleyezz Posted February 28, 2011 Share Posted February 28, 2011 Ok, I submit the form, and when the next page displays, it says recieved with the persons name, but it wont post their email, and it wont ever send the message to the email address......... i've been playing with it all day long and just cannot figure it out, about to rip my hair out... any help would be appreciated. Contact.php page <?php // Header Include include('includes/header.php'); ?> <!-- BEGIN SITE CONTENT INCLUDES HERE --> <!-- Index page included --> <table border="0" cellpadding="5" cellspacing="0" width="300" align="center"> <tr> <td><font face="verdana" size="2" color=#"000000"><b>Feedback Form</b></font></td> <tr> <td><form name="contact" method="post" action="contact_submit.php"> <font face="verdana" size="1" color="#1b4a1b">Your Name:<br /> <input type="text" name="name" size="25" /> <br /> Email:<br /> <input type="text" name"email" size="25" /> <br /> Comments:</font><br /> <textarea name="comments" rows="5" cols="30"></textarea> <br /><input type="submit" name="submit" value="Send" /> </form></td> </tr> </table> <br /><br /> <!-- / End Index Page --> <!-- / END SITE CONTENT INCLUDES HERE --> <!-- Footer Include --> <?php include('includes/footer.php'); ?> Form Processing Script contact_submit.php <?php $to = "[email protected]"; $re = "Feedback Form"; $msg = $comments; mail($to,$re,$msg); ?> <html><head><title>Message Recieved</title></head> <body> <h3>Thank you for your feedback <?PHP echo ($name); ?></h3> <br />We value your opinions and any questions will be replyed to your email address: <?php echo ($email); ?> </body></html> Does anyone have any idea wtf is wrong? Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/ Share on other sites More sharing options...
.josh Posted February 28, 2011 Share Posted February 28, 2011 As for not seeing posted info: unless you have register globals turned on (which you shouldn't, and isn't something on be default unless you are using an old version of php), you can access posted variables using the $_POST array. Example: $_POST['email'] As for not getting mail: First off, did you check your spam/trash/junk folder? Where are you running this script from? using the mail() requires a mail server to be setup. If you are doing t his on your own computer with something like WAMP or XAAMP then you more than likely do not have a mail server setup. Or, if you are running this off some really cheap or free hosting service, more than likely they do not allow you to use things like mail(). Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180601 Share on other sites More sharing options...
Angeleyezz Posted February 28, 2011 Author Share Posted February 28, 2011 i have a hosted reseller account with vortechhosting.com, i posted my php info for you http://www.reelkingz.com/phpinfo.php Definitally not in the junk folder, I was hoping it would have ended up there, but it didnt. The weird thing is it will take the $name from the post, but it wont take the $email from there and print it on the result page, thats the part thats got me really confused. aside from the message not sending at all. I don't have access to change the php.ini file at all, so im kinda stuck outta luck with that if theres something out of place on the info, do you see anything out of place on why the script isnt working from the info? Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180606 Share on other sites More sharing options...
.josh Posted February 28, 2011 Share Posted February 28, 2011 well as for $email not showing up, i see in your form <input type="text" name"email" size="25" /> you are missing the = for name="email" but..if you see $name just fine and then adding that = will fix seeing $email...that means that you DO have register globals turned on?? edit: holy crap, you DO have register globals turned on! (I see it in your phpinfo() you posted). IMO you should probably find a new host ASAP. A hosting company who allows this sort of thing... Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180608 Share on other sites More sharing options...
Angeleyezz Posted February 28, 2011 Author Share Posted February 28, 2011 so my problem is that register globals is turned on? wonderful, i guess im going to be in the market for a new reseller this week lol. Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180613 Share on other sites More sharing options...
.josh Posted February 28, 2011 Share Posted February 28, 2011 Well no, your script is not NOT mailing because of register globals being on (it should be off, not on). that's unrelated. I don't really see an immediate reason why it shouldn't be working. Try sending some proper email headers (see example #2 of the mail manual entry). Try sending to a couple different email addresses. Perhaps gmail doesn't like your host and is automatically filtering emails from it. Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180614 Share on other sites More sharing options...
Angeleyezz Posted February 28, 2011 Author Share Posted February 28, 2011 ok i tried a few mails, no good on any of them..... Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180617 Share on other sites More sharing options...
Angeleyezz Posted February 28, 2011 Author Share Posted February 28, 2011 *bump* still not working, i tried $_POST['comments']; also and still nothing. tried with diff email addresses from diff services. Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180831 Share on other sites More sharing options...
.josh Posted February 28, 2011 Share Posted February 28, 2011 did you try changing mail() to send headers as shown in the document link? Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180838 Share on other sites More sharing options...
Angeleyezz Posted February 28, 2011 Author Share Posted February 28, 2011 you mean replace my code with this? then what just access the page and itll automatically send it? im kinda new at this also lol <?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180845 Share on other sites More sharing options...
Angeleyezz Posted February 28, 2011 Author Share Posted February 28, 2011 ok i replaced the code with that code i posted from the example, changed the email, uploaded it, and went to the address.... the page went white with nothing on it, so i'm assuming it the script worked, but i have not recieved any email Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180847 Share on other sites More sharing options...
.josh Posted February 28, 2011 Share Posted February 28, 2011 okay well at this point in time, my suggestion would be to talk to your host and ask them to make sure stuff is setup right on their end, like ask them to make sure their email server is setup correctly. Show them your script as a reference. I can't think of any other reason why the script would fail, unless every email address you tried to send it to just so happens to block email from your host... which I suppose is possible if they have a history of spammers sending email from them. But yeah..I think at this point in time it would be appropriate to hit your host up and ask them wtf. Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180850 Share on other sites More sharing options...
Angeleyezz Posted February 28, 2011 Author Share Posted February 28, 2011 the host is terrible anyway, their too expensive, and it seems like they went down hill over the years. im going to migrate to someone new, any suggestions for a good reseller? i was looking into hostclear.com i donot know..... I even tried to make an email address from my own domain and sent the "to" to that mail, and still, nothing..... sad Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180852 Share on other sites More sharing options...
.josh Posted February 28, 2011 Share Posted February 28, 2011 I don't really know offhand any good reseller hosts / reseller hosting plans. Maybe a good place to start before making your own thread is the Web Host List sticky that lists suggested/recommended hosts. Perhaps people specifically listed reseller features as reasons. Or if nobody specifically mentions your needs in that thread, you can always start your own thread asking about it in the Misc. Forum Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180876 Share on other sites More sharing options...
Angeleyezz Posted February 28, 2011 Author Share Posted February 28, 2011 ok im giving hostclear a chance, they seem pretty good from all the reviews i read all over the place, going to wait for the account to get setup, etc and in a few days ill try the script over there... if it still doesnt work..... lol then i dont know. Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1180896 Share on other sites More sharing options...
Angeleyezz Posted March 2, 2011 Author Share Posted March 2, 2011 SOLVED! The problem lied with the crappy host, because the dns just propgated on the new host, and presto, i tested the example #2, twice and it went right through no problems at all. Thank you ! =) now i can go back to building this site Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1181672 Share on other sites More sharing options...
Twistedweb123 Posted March 2, 2011 Share Posted March 2, 2011 Which host are you using? phps inbuilt mail function is great, however some hosting companies are cracking down on how it is used. for example, godaddy is very unreliable when it comes to using mail(). mail usually doesnt get sent, or is very very delayed. This is due to godaddy being accussed of spam etc due to spamming customers. To make mail work on hosts such as godaddy, you need to look into using something like pear & php's mail together. look here: http://pear.php.net/ Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1181681 Share on other sites More sharing options...
Angeleyezz Posted March 2, 2011 Author Share Posted March 2, 2011 im using godaddy as my name host, and hostclear.com as my new web host. works great =) Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1181683 Share on other sites More sharing options...
Twistedweb123 Posted March 2, 2011 Share Posted March 2, 2011 so before you moved to hostclear, the script wasnt working on godaddy? Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1181690 Share on other sites More sharing options...
Angeleyezz Posted March 2, 2011 Author Share Posted March 2, 2011 no, but the domain is still registered with godaddy. Quote Link to comment https://forums.phpfreaks.com/topic/229080-simple-email-script-problems/#findComment-1181860 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.