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@yourserver.com 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
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...

 

Link to comment
Share on other sites

<?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@yourserver.com 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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