I'm hosting a website on a Linux server, running Ubuntu Server 11.04 (32 bit). The web server is Apache. One of the pages on the site has a form with the submit linking to a PHP email script. Form code:
<form id="contact_form" method="post" action="email.php">
<table>
<tr>
<td>Name:</td>
<td><input type="text" id="name" class="textbox"/></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" id="email" class="textbox"/></td>
</tr>
</table>
<div id="message_box_header">Describe your problem:<br /></div>
<textarea class="textbox"></textarea><br />
<input type="submit" value="Submit!" id="submit" />
</form>
The Linux server has the most up to date version of sendmail. I don't know PHP well at all and got the script pre-written, so I imagine my problem is probably there. I replaced the website/emails with dummy ones, for privacy. Here's email.php:
<?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
mail( "[email protected]", "Form Data",
$message, "From: $email" );
header( "Location: http://mywebsite.com" );
?>
When I click the submit button on the actual website, it just downloads email.php.
?>at the end and addexit;to the end.$_POSTinstead of$_REQUESTfor post data, and use$_GETfor get data.