Ajna Posted June 19, 2009 Share Posted June 19, 2009 Greetings! I am a beginner of PHP. I have a Flash Contact Form Template that I downloaded from the internet. The Contact Form sends the email to my address but the Subject, Message and From does not appear in the email. I would appreciate any assistance on what I need to do to correct it. Here is the code... <? $to = "your@email.com"; $msg = "$name\n\n"; $msg .= "$message\n\n"; mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n"); ?> Where it says your email I have put my email. Here is the page http://nvi.hostei.com/gptw/form.html Thanks in advanced. Quote Link to comment Share on other sites More sharing options...
trq Posted June 19, 2009 Share Posted June 19, 2009 $name, $message, $email and $subject are not defined anywhere in the code your showing us. And please, pay off the large font. Quote Link to comment Share on other sites More sharing options...
EchoFool Posted June 19, 2009 Share Posted June 19, 2009 Well can we see the rest of the PHP script we don't know if your were setting it from the POST Quote Link to comment Share on other sites More sharing options...
Ajna Posted June 19, 2009 Author Share Posted June 19, 2009 That is how the code was given to me. I copy and paste what I see and follow the instructions included. Like I said I am a beginner. I am posting at this site because it seems friendly to those learning PHP. I of course have lots to learn. Can anyone suggest something that will work and is simple? Quote Link to comment Share on other sites More sharing options...
jmann1 Posted June 19, 2009 Share Posted June 19, 2009 There are countless form processors out there for download. Many of them include very concise install and config instructions. You can also look for online form generators that will create a form based on your input. Google "php form processor" and you can spend the rest of the day finding one that fits your needs. Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 19, 2009 Share Posted June 19, 2009 Lol wonda who is that great person who coded that form in ur template. So manythings mising. Post ur hmtl form here 2 Quote Link to comment Share on other sites More sharing options...
chmpdog Posted June 19, 2009 Share Posted June 19, 2009 If I were you I would consider finding a new code. here is one from php.net: <?php // multiple recipients $to = 'aidan@example.com' . ', '; // note the comma $to .= 'wez@example.com'; // subject $subject = 'Birthday Reminders for August'; // message $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n"; $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?> Quote Link to comment Share on other sites More sharing options...
Ajna Posted June 21, 2009 Author Share Posted June 21, 2009 Thanks everyone. I will let you know what I come up with when I find time. Quote Link to comment Share on other sites More sharing options...
pkedpker Posted June 21, 2009 Share Posted June 21, 2009 Ajna. I have decompiled your form.swf and I found this loadVariablesNum("form.php", 0, "POST"; it means it uses POST it also means you have error there.. you are missing closing bracket before the ; (semicolon).. maybe my decompiler is bad. <? $to = "your@email.com"; $msg = "$name\n\n"; $msg .= "$message\n\n"; mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n"); ?> has to be <?php $name = $_POST['name']; $subject = $_POST['subject']; $message = $_POST['message']; $email= $_POST['email']; $to = "your@email.com"; $msg = "$name\n\n"; $msg .= "$message\n\n"; mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n"); ?> should work then. Quote Link to comment Share on other sites More sharing options...
Ajna Posted June 22, 2009 Author Share Posted June 22, 2009 I found some codes that finally worked. Thanks pkedpker! When I get a chance I will definitely use the codes that you have posted. Since you went through all of that work. Then I will post my results. Quote Link to comment Share on other sites More sharing options...
chmpdog Posted June 24, 2009 Share Posted June 24, 2009 pked what decompiler did you use? Quote Link to comment Share on other sites More sharing options...
Ajna Posted July 6, 2009 Author Share Posted July 6, 2009 pkedpker, I finally got a chance to add the corrected codes that you provided. Your decompiler misread the code... there was a bracket before the semicolon. Your PHP script allowed the email to be sent but the name, email, subject and message was not filled in. Thank You for your time. Truly appreciated it. I would like to learn more, could you provide some good beginner sources to learn PHP? Ajna Quote Link to comment Share on other sites More sharing options...
elis Posted July 6, 2009 Share Posted July 6, 2009 Regarding sources to help you learn PHP, I would suggest using http://www.tizag.com/phpT/ which focuses on covering PHP in a way that's easily understood for beginners. Quote Link to comment Share on other sites More sharing options...
Ajna Posted July 9, 2009 Author Share Posted July 9, 2009 Thanks elis Quote Link to comment 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.