I think an element of my site used to work, but now doesn't.
I have a page in which an email message is constructed from text-data from an MYSQL dbase and includes input from a regular textarea called "comment". The email address "email1" is also input on the same page.
The problem is that the email arrives at its destination without the "comment" text from the textatrea.
Can you tell me what's going wrong, please. I quote what I hope is the relevant code.
Later we have:
and:
The website is one that lists mental health resources. If you go to the page given you will see the form by clicking the "Send info as Email" buttons in the right-hand cells.
Many thanks for looking at this for me.
Steve
I have a page in which an email message is constructed from text-data from an MYSQL dbase and includes input from a regular textarea called "comment". The email address "email1" is also input on the same page.
The problem is that the email arrives at its destination without the "comment" text from the textatrea.
Can you tell me what's going wrong, please. I quote what I hope is the relevant code.
PHP:
$org = $row_restSelect['cel_org'];
$tel = $row_restSelect['cel_tel'];
$fax = $row_restSelect['cel_fax'];
$help = $row_restSelect['cel_hlp'];
$mail = $row_restSelect['cel_email'];
$web = $row_restSelect['cel_web'];
$address = $row_restSelect['cel_add'];
$details = strip_tags($row_restSelect['cel_blb']);
$handouts = $row_restSelect['cel_hndts'];
$message = "Message: $comment \n\n"; // Set up the email message to the client.
$message .= "Information about $org from [URL unfurl="true"]www.torbaymhresources.org.uk[/URL] website.\n\n";
$message .= "Contact Details: \n";
$message .= "Tel No. $tel \n";
$message .= "Fax No. $fax \n";
$message .= "Helpline: $help \n";
$message .= "Email: $mail \n";
$message .= "Website: $web \n\n";
$message .= "Postal Address: $address \n\n";
$message .= "Description of Service:\n $details \n\n";
$message .= "$handouts";
$inform_me = "Details of $org have been sent to someone"; // Set up the email to inform me of the information request.
// The emails:
if(mail("$email1", $org, $message, "From: [URL unfurl="true"]www.torbaymhresources.org.uk")[/URL] && mail("feedback@torbaymhresources.org.uk", $org,
$inform_me, "From: [URL unfurl="true"]www.torbaymhresources.org.uk"))[/URL]
{
header('location: [URL unfurl="true"]http://www.torbaymhresources.org.uk/feedback/email_redirect.php');//[/URL] redirect to page if email has been successfully sent
exit;
}else{
$error == '<p style="color:red;">An error occured, your email could not be sent. Please try
again</p>';
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>Email Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="fb.js"></script>
<link href="../css/mentalhealth_bx.css" rel="stylesheet" type="text/css" />
</head>
<body class="grey_bground" >
<form action="<?php echo $PHP_SELF; ?>" method="post" name="email1" id="email1">
<?php echo $error; ?>
Later we have:
Code:
<tr>
<td width="223" align="right"><p> </p>
</td>
<td colspan="3" valign="top">
<textarea name="comment" cols="70" rows="2"
onclick="document.email1.comment.value='';">Mouse-click to clear text - Write a message here if you wish.</textarea>
<!-- javascript to clear text from text area onclick --></td>
</tr>
and:
Code:
<td><input name="email1" type="text" size="40" value="" />
<input name="send" type="submit" value=" Send " />
<input type="hidden" name="org_pk" id="org_pk"
value="<?php echo $_POST['org_pk']; ?>" />
</td>
The website is one that lists mental health resources. If you go to the page given you will see the form by clicking the "Send info as Email" buttons in the right-hand cells.
Many thanks for looking at this for me.
Steve