I come from C# background and im new to php, I have an html form submits it's values to the following php file and for some reason the values are not set, what am I doing wrong?
<?php
include('Mail.php');
$recipients = "myemail@hotmail.com";
$name = $_POST["txtName"] ;
$from = $_POST["txtEmail"] ;
$subject = $_POST["txtAppName"] ;
$comments = $_POST["txtComment"] ;
$headers = array (
'From' => $from,
'To' => $recipients,
'Subject' => $subject,
);
$body = "Name: ".$name."\r\n"."Comments: "."\r\n".$comments;
$mail_object =& Mail::factory('smtp',
array(
'host' => 'prwebmail',
'auth' => true,
'username' => 'username',
'password' => 'pass', # As set on your project's config page
'debug' => true, # uncomment to enable debugging
));
$mail_object->send($recipients, $headers, $body);
?>
And here is the html form:
<form action="sendfeedback.php" method="post">
<div><input placeholder="Name" id="txtName" type="text" /></div>
<div><input placeholder="Email (Optional)" id="txtEmail" type="text" /></div>
<div><input placeholder="Application Name (Type in the application name you're using)" id="txtAppName" type="text" /></div>
<div style="height:4px"></div>
<div><textarea placeholder="Comments..." id="txtComment"></textarea></div>
<div style="width:407px; text-align:right;"><input id="submitComment" type="submit" value="Send" /></div>
</form>