millend Posted February 15, 2008 Share Posted February 15, 2008 Hi all.. can someone please quickly show me how to make the variable $telefon also show up in email... I know this is about the most stupidest question in this forum, but i just need a little help... <?php // read the variables form the string, (this is not needed with some servers). $subject = $_REQUEST["subject"]; $message = $_REQUEST["message"]; $sender = $_REQUEST["sender"]; $telefon = $_REQUEST["telefon"]; // include sender IP in the message. $full_message = $_SERVER['REMOTE_ADDR'] $telefon. "\n\n" . $message; $message= $full_message; // remove the backslashes that normally appears when entering " or ' $message = stripslashes($message); $subject = stripslashes($subject); $sender = stripslashes($sender); $telefon = stripslashes($telefon); // add a prefix in the subject line so that you know the email was sent by online form $subject = "Teade www.avante.ee'st ". $subject; // send the email, make sure you replace [email protected] with your email address if(isset($message) and isset($subject) and isset($sender)){ mail("****@gmail.com", $subject, $message, "From: $sender"); } ?> Thank you in advance! Link to comment https://forums.phpfreaks.com/topic/91223-newbie-quick-help-please/ Share on other sites More sharing options...
PHP Monkeh Posted February 15, 2008 Share Posted February 15, 2008 Do you have a field called "telefon" in your form? Also are you using POST or GET as your form method? Link to comment https://forums.phpfreaks.com/topic/91223-newbie-quick-help-please/#findComment-467534 Share on other sites More sharing options...
millend Posted February 15, 2008 Author Share Posted February 15, 2008 yes, everything is fine from the other side... even when i change the code myself I can get the variable $telefon to show up in main email body, but i cannot modify the script to show both $telefon and $message at the same time... :S thanks in advance... Link to comment https://forums.phpfreaks.com/topic/91223-newbie-quick-help-please/#findComment-467535 Share on other sites More sharing options...
millend Posted February 15, 2008 Author Share Posted February 15, 2008 and using POST from flash side... Link to comment https://forums.phpfreaks.com/topic/91223-newbie-quick-help-please/#findComment-467536 Share on other sites More sharing options...
PHP Monkeh Posted February 15, 2008 Share Posted February 15, 2008 <?php // read the variables form the string, (this is not needed with some servers). $subject = $_POST["subject"]; $message = $_POST["message"]; $sender = $_POST["sender"]; $telefon = $_POST["telefon"]; // include sender IP in the message. $full_message = $_SERVER['REMOTE_ADDR']."\n\n".$telefon."\n\n".$message; $message= $full_message; // remove the backslashes that normally appears when entering " or ' $message = stripslashes($message); $subject = stripslashes($subject); $sender = stripslashes($sender); $telefon = stripslashes($telefon); // add a prefix in the subject line so that you know the email was sent by online form $subject = "Teade www.avante.ee'st ". $subject; // send the email, make sure you replace [email protected] with your email address if(isset($message) and isset($subject) and isset($sender)){ mail("****@gmail.com", $subject, $message, "From: $sender"); } ?> That should be better Link to comment https://forums.phpfreaks.com/topic/91223-newbie-quick-help-please/#findComment-467537 Share on other sites More sharing options...
millend Posted February 15, 2008 Author Share Posted February 15, 2008 thank you, thank you thank you...! ! ! Link to comment https://forums.phpfreaks.com/topic/91223-newbie-quick-help-please/#findComment-467538 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.