Jump to content

newbie quick help please


millend

Recommended Posts

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

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...

 

<?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 :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.