Form to Mail

Im sure lots have people have posted about the post to mail forms below but i can not understand why this one is not working as i have had it run on other web servers but can not get it to work on this current web server. Ok here it is this is the error message im getting… I did look up the error message and it says undefined variable is the course of the error but i have had this exact code working on another server.

Notice: Undefined index: attn in /home/fhlinux160/e/mywebsite.com/user/htdocs/pages/tutorials/sendeail.php on line 169

Here is the sendeail.php

<?php $ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $notes = $_POST['notes']; $attn = $_POST['attn']; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "

Use Back - Enter valid e-mail

n"; $badinput = "

Feedback was NOT submitted

n"; echo $badinput; die ("Go back! ! "); } if(empty($visitor) || empty($visitormail) || empty($notes )) { echo "

Use Back - fill in all fields

n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $attn = $attn ; $subject = $attn; $notes = stripcslashes($notes); $message = " $todayis [EST] n Attention: $attn n Message: $notes n From: $visitor ($visitormail)n Additional Info : IP = $ip n Browser Info: $httpagent n Referral : $httpref n "; $from = "From: $visitormailrn"; mail("[email protected]", $subject, $message, $from); ?>

Date: <?php echo $todayis ?>
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
Message:
<?php $notesout = str_replace("r", "
", $notes); echo $notesout; ?>
<?php echo $ip ?>

The error is in the above file it says in the error message but in case you need it here is the code i use for the form:

<?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?>

Your Name:






Your Email:






Mail Message:







i just realised that now i have cut the code out of my web page it wont be like 169.

The line it was having trouble with is:
$attn = $_POST[‘attn’];

Any help would be much appreciated

Ben

Sponsor our Newsletter | Privacy Policy | Terms of Service