Hello guys,
Got another problem with a mail form I am using. I found it on google and it works fine, its a HTML form which uses PHP to send the form data to an email address. The problem I have is I cannot get the htmlspecialchars function to work with it. I’ve tried various solutions but every time I try they don’t work. I’ll paste the PHP code here with the HTML form to see if someone can work it out.
I think the main problem is because it uses an array, but seeing as I’m not too good on arrays, I can’t get it to work. I’ve tried using the array_map function but that didn’t seem to work. Some help on this would be great!
The HTML Form:
<form method="post" action="info.php">
<table bgcolor=#ffffcc align=center>
<tr><td colspan=2><strong>Your Information:</strong></td></tr>
<input type="hidden" name="sendto" value="[email protected]">
<tr><td><font color=red>*</font> Character Name:</td><td><input size=25 name="Name"></td></tr>
<tr><td><font color=red>*</font> Your Email:</td><td><input size=25 name="Email"></td></tr>
<input type="hidden" name="price" value="">
<tr><td>Phone:</td><td><input size=25 name="Phone"></td></tr>
<tr><td colspan=2>Message:</td></tr>
<tr><td colspan=2 align=center><textarea name="Notes" rows=5 cols=35></textarea></td></tr>
<tr><td colspan=2 align=center><input type="submit" name="send" value="Submit"></td></tr>
<tr><td colspan=2 align=center><small>A <font color=red>*</font> indicates a field is required</small></td></tr>
</table>
</form>
The PHP Script:
[php]
[/php]
I’ve tried using htmlspecialchars like this:
[php] $from = htmlspecialchars($_REQUEST[‘Email’], ENT_QUOTES);[/php]
That didn’t seem to work.
Any ideas?
Thanks