I have the following in my controller:
$message['name'] = htmlentities(strip_tags(trim($_POST['name'])));
$message['email'] = htmlentities(strip_tags(trim($_POST['email'])));
$to = "info@mywebsite.com";
$subject = "Website Enquiry";
$content = html_entity_decode(implode("nn", $message));
$content.= "nnIP Address: ".$_SERVER['REMOTE_ADDR'];
$headers = "From: ".strip_tags(trim($_POST['name']))." <".strip_tags(trim($_POST['email'])).">";
@mail($to,$subject,$content,$headers);
And the following in my view:
echo '<tr><th><b>Name: </b></th><td>'.$message['name'].'</td></tr>';
echo '<tr><th><b>Email Address: </b></th><td>'.$message['email'].'</td></tr>';
This works as expected - the POST data is output to the page and is also sent in the email. However the email does not contain the field labels, for example 'Name: ' and 'Email Address: '.
This is obviously because I don't include the labels in their respective $message[] elements, as I need to enclose these in HTML tags in the view. I don't intend to include any HTML code in my controller, so does anyone have any idea how I can satisfy both requirements?
DateObject and Nulls
Hi all,I have an array mapped to a value object. One of the items in the array is a PHP DateObject, and I need to format this field appropriately.When looping through the array, I pass this field to a
DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This is mostly fine but one problem I have is when I do this:Code:
PHP time (deadline within one week)
I have a column ['projdue'], which stores the deadline for a project.I have PHP code and <span class>'s to show projects that are within timescale, due today and overdue:Code:
single values into sql field
i have a form which i want the user to able to select multiple answers. But i want the answers to be stored into a single field on the mysql table in the back end. e.gthe user may select red + blue +
Port scanner problem
Hai recently i developed one app through which u can check the opened and closed ports under an ip address or domain.but there is a small error.if no port numbers are given then it should scan from
Displaying Site Logo/Icon on a Title tag
really need some help out here. I want to insert a Logo/Icon just like the one close to the "PHP Freaks" title bar. But kinda finding it difficult to do that. Don't know if to echo the image
Oracle Connectivity
Hi Every One,
How to replace search button with link?
hi to everbody.i have a search submit form and button like this :<form id="f1" name="title" method="post"
socket makes browser hang...
I have a socket server, and I am having a problem at the moment...A browser sends a http header request to the server, but... some browsers send one request for one file, and others want 2. For
Intrastat Report Config in ECC 6.0 - goods Movement in EU countries
Colleagues, need ur help to understand the changes require in ECC 6 standard Report configuration settings.