I wouldn’t consider myself a php programmer by any means, but I feel comfortable messing around with pre-written scripts and such. A few years ago I started using php to submit forms on a lot of our websites. Recently we’ve fallen to some hacking due (from what we can tell) register_globals being on. When they are off, my forms do not work. The emails come through as if no one has filled out any of the form fields.
I would appreciate it if someone could look at my code and let me know what I’m doing wrong.
Here’s the code for the form.
[CODE]<form action=”contactaction.php” method=”post”>
<table width=”357″ border=”0″ cellspacing=”0″ cellpadding=”2″>
<tr align=”left” valign=”middle”>
<td colspan=”2″>Or feel free to use the following email form. </td>
</tr>
<tr align=”left” valign=”middle”>
<td width=”54″>Name:</td>
<td width=”295″><input name=”name” type=”text” id=”name” size=”40″ /></td>
</tr>
<tr align=”left” valign=”middle”>
<td>Email:</td>
<td><input name=”thereemail” type=”text” id=”thereemail” size=”40″ /></td>
</tr>
<tr align=”left” valign=”middle”>
<td>Subject:</td>
<td><input name=”subject” type=”text” id=”subject” size=”40″ /></td>
</tr>
<tr align=”left” valign=”middle”>
<td>Message:</td>
<td><textarea name=”message” cols=”30″ rows=”5″ id=”message”></textarea></td>
</tr>
<tr align=”center” valign=”middle”>
<td> </td>
<td><input type=”submit” name=”Submit” value=”Submit” /></td>
</tr>
</table>
</form>
And the action.
[CODE]<?php
{
$email = “Name:t$namenE- Mail:t$thereemailnSubject:t$subjectnMessage:t$messagenn”;
$to = “*****@gmail.com”;
$subject = “contact page”;
$mailheaders = “From: $name”;
$mailheaders = “Reply-To: $thereemail”;
mail($to, $subject, $email, $mailheaders);
include(“thanks.php”);
}
?>
I’m sure it is something stupid, but this format has worked perfectly for me for quite a while. If anyone has any ideas or help I would GREATLY appreciate it.