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?
Reading waves
Hi,I am trying to find a way of finding the highs and lows on a graph line, the line points will be given in the form (x,y). Does anyone know a way to do this or a tutorial that will show me how to do
Pipe email to PHP - get mail adress from MySQL - send?
Hi all,this is the challenge:1) Our faculty at the college where I'm employed includes quite a bit of freelancers that don't check the college mailbox quite as often as the administration would
Undefined variable when using $_SERVER['PHP_SELF']
Hi guyz, please suggest me something...On first.php I have one input field NAME, and on posting the form it moves to "second.php" showing the entered value of input field using $_POST,
Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,The code below works great. It creates a table that shows the 25 most recently added tables to a MySQL database called "sitefeather."Each one of these tables has the following
close site for maintenance
i get a tutorial, saying the following code can put our site offline, and only the developer can view the siteCode: [Select]RewriteEngine OnRewriteBase /RewriteCond %{REMOTE_ADDR}
Displaying data from MySql a different way
Hi all,I'm pretty new to php and MySql and have hit a problem.I am able to display data in a table using the following code:<?php $database="MYDATABASE"; mysql_connect
How to make a mail Form secure?
I want to create an email Form on my web site. How can I make the Form secure so the submitted info going to the database gets there securely?
While Problem
i am having a problem with a while statement here is the code Code:
I have a parse error in this query help..
Code: $query1="INSERT INTO `rating` (`item_name`, `rating`, `ip_address`, `date_rated`) VALUES ('{$varItem}', {$varRating}, '{$ipAddress}', NOW())", "InsertRating";Parse error
help countdown timers
hello every one,I'd like to know how to insert many countdowns in the same page.The duration of each must be different and defined by members with a form.