I have this simple script that seems to work fine except that it always shows Nobody as the sender when it is received by Outhouse Express. Inside the body of the email all information is present. I would like to accomplish this one of of two ways: 1. First choice would be for it to tag it automatically with mydomain/subdomain 2. Second choice would that I enter the domain manually into each instance of the script. Only a snippet shown. Line breaks added for readablity. Last question any known security issues with any of the above?
You need from in the email headers. $from_domain = $_SERVER["HTTP_HOST"]; if (substr($from_domain,0,4) == "www.") $from_domain = substr($from_domain,4); $from_name = "Your Name"; $from_email = "email@$from_domain"; mail ($to, $subject, "A message from $name at $email:\r\n $message \r\n\r\n$name's remote host is $REMOTE_HOST and $name's specified hostname is $VIRTUAL_REMOTE_HOST. \r\nThe sender's IP Address is $REMOTE_ADDR and the sender's \r\nUser-Agent string is $HTTP_USER_AGENT.", "From: $from_name <$from_email>\r\n" ) or print "An unknown error occured.<br>"; PHP:
Global variables ($REMOTE_ADDR, $HTTP_USER_AGENT) = bad http://us2.php.net/manual/en/security.globals.php $_SERVER["REMOTE_ADDR"] $_SERVER["HTTP_USER_AGENT"]