PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
#as for the table prob, why not try something like htmlentities()
#or strip_tags() depdning on what you want to do.
#if you want to rid the message of HTML in general use strip_tags
#if you want to make all characters remain HTML when they should use htmlentities()
$msg = "#given subject\r\n";
$msg .= "Sender's NAME: \t{$_POST['name']}\r\n";
$msg .= "Sender's EMAIL:\t{$_POST['sender_email']}\r\n";
$msg .= "Sender's TITLE:\t{$_POST['title']}\r\n";
$to = "#email\r\n";
$subject = "##your subject\r\n";
$mailtoheaders = "#from who <##email>\r\n";
#if you have a $_POST['sender_mail'] you can reply to them in your mail
$mailheaders .= "Reply-To: {$_POST['sender_email']}\r\n";
mail($to, $subject, $msg, $mailheaders);
?>
Last edited by akimm on Sat Oct 28, 2006 7:40 pm, edited 1 time in total.
You're passing the return value of mail() to htmlentities().
The return value of mail() is a boolean, i.e. TRUE or FALSE.
so what is htmlentities(true)/htmlentities(false) about?
volka wrote:It's neither scolding nor goofing on you.
Well..it did sound like you were.
Where?
If you mean the two simple questions then I really don't care if you feel that way. I won't stop asking about the basics. It's not to make you feel bad or me feeling better but to make you think about what can and what can't be - from the basics, nothing sophisticated.
...shows that htmlspecialchars has no effect on a boolean and is an unnecessary step.
htmlspecialchars is better than entities but with either once you should always specify the ENT_QUOTES param.
Guys there's nothing wrong with suggesting what to look at in the code without giving a direct answer. If it makes you do some reading and think about it then we've succeeded in helping you to learn. We're her to help you to learn; not to give you all the answers