Greg_elite Posted December 30, 2010 Share Posted December 30, 2010 Can I replace the set message text for $body and $subject with $_POST['message']; $_POST['subject']; so I can get a users input from a html form via php as the action. Instead of the set text in the script. As seen http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm Link to comment https://forums.phpfreaks.com/topic/222958-a-quick-question-about-a-form/ Share on other sites More sharing options...
dragon_sa Posted December 30, 2010 Share Posted December 30, 2010 Short answer yes just define it $subject=$_POST['subject']; $body=$_POST['message']; Link to comment https://forums.phpfreaks.com/topic/222958-a-quick-question-about-a-form/#findComment-1152817 Share on other sites More sharing options...
requinix Posted December 30, 2010 Share Posted December 30, 2010 Sure. Beware of people putting malicious stuff in the body - they might try using a While you're at it, try to limit the length of the subject line. A hundred or so characters ought to be enough. Link to comment https://forums.phpfreaks.com/topic/222958-a-quick-question-about-a-form/#findComment-1152818 Share on other sites More sharing options...
Greg_elite Posted December 30, 2010 Author Share Posted December 30, 2010 Short answer yes just define it $subject=$_POST['subject']; $body=$_POST['message']; So can I do exactly that instead of the set text in the script? This would get what the user inputed, just by replacing it to this? BTW Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/222958-a-quick-question-about-a-form/#findComment-1152820 Share on other sites More sharing options...
Greg_elite Posted December 30, 2010 Author Share Posted December 30, 2010 Is that a yes? Help!? Link to comment https://forums.phpfreaks.com/topic/222958-a-quick-question-about-a-form/#findComment-1152822 Share on other sites More sharing options...
dragon_sa Posted December 30, 2010 Share Posted December 30, 2010 Yes, try it Link to comment https://forums.phpfreaks.com/topic/222958-a-quick-question-about-a-form/#findComment-1152826 Share on other sites More sharing options...
Greg_elite Posted December 30, 2010 Author Share Posted December 30, 2010 Yes, try it Thanks Guy's! SOLVED!!! Link to comment https://forums.phpfreaks.com/topic/222958-a-quick-question-about-a-form/#findComment-1152833 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.