PHP email function problem
Posted: Fri Dec 14, 2007 8:31 am
feyd | Please use
Once the user presses send, it is taken to another page. This new pages is “contactSent.php” where the user is told that his info was sent and then using php functions an email is generated and sent to the email that you set up in the php code. Here is the code for this page[/syntax]
And so it stopped working partially. I get the email in the inbox, I see that variables values of the date, ip, etc. The only things I don’t see are the values inside of $message. I get would get any text typed inside the function, but not the value of the variables. I’m suppose to get something like this:
Name: WHATEVER NAME IT WAS ENTERED
Instead I just get
Name:
Going deeper in details, all the sites are hosted at different host companies.
Thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have this form on my site that it was working until recently and that I have use for years. All of a sudden it stops working on all my sites. It works by the user arriving at the page “contact.php” where the user fills up the form and press send. Here is the code for that page in a simple form.
[syntax="html"]<html>
<head>
<title>SITE TITLE</title>
</head>
<body>
<form action="ContactSent.php" method="post">
Enter Name: <input name="name" type="text" id="name">
<input type="submit" name="Submit" value="Send">
</form>
</body>
</html>Code: Select all
<html>
<head>
<title>SITE TITLE</title>
</head>
<body>
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type=hidden name="ip" value="<?php echo $ipi ?>">
<input type=hidden name="httpref" value="<?php echo $httprefi ?>">
<input type=hidden name="httpagent" value="<?php echo $httpagenti ?>">
<?php
$myemail = "USER@DESTINATIONYOUCHOOSE.COM";
if (!isset($email))
echo "$ip" ;
$todayis = date("l, F j, Y, g:i a") ;
$subject = "EMAIL SUBJECT";
$message = "
Name: $name \n
$ipi \n
$todayis [EST]
";
$from = "From: $myemail\r\n";
if ($myemail != "")
mail($myemail, $subject, $message, $from);
?>
message sent
</body>
</html>Name: WHATEVER NAME IT WAS ENTERED
Instead I just get
Name:
Going deeper in details, all the sites are hosted at different host companies.
Thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]