...

View Full Version : My form? Links and Code



Crispy
07-24-2008, 01:17 PM
Basically, I'm trying to create a contact form for my site.. Here's a link to the site:

http://aboutchris.co.uk/Reflex/contact.php

It all seems to work, except when i recieve the mail all i get is "Inquiry" But no $message. And I can't work out why :( maybe you guys with more php knowledge might know why?

Here's the sendmail.php:


<?
$author = $_GET['author'] ;
$email = $_GET['email'] ;
$url = $_GET['url'] ;
$message = $_GET['message'] ;
mail('crispy.uk@gmail.com', 'Inquiry', $message);
print "Congratulations your email has been sent";
?>


Here's the form HTML:


<form action="sendmail.php" method="post" id="commentform">


<p><label for="author">Name (required)</label>

<input type="text" name="author" id="author" value="" size="22" tabindex="1" class="required" minlength="4" />
</p>

<p><label for="email">Mail (required)</label>

<input type="text" name="email" id="email" value="" size="22" tabindex="2" class="required email" />
</p>

<p><label for="url">Website</label>
<input type="text" name="url" id="url" value="" size="22" tabindex="3" class="url" />
</p>

<p><label for="message">Message</label>

<textarea name="message" id="message" cols="5" rows="10" tabindex="4" class="required" minlength="10" maxlength="100"></textarea>
</p>
<br />
<p>
<input name="submit" type="submit" id="submit" tabindex="5" value="Send Message" />

<input type="hidden" name="comment_post_ID" value="1" />
</p>
</form>


Really stuck on this one guys :) any help much appreciated!

abduraooft
07-24-2008, 01:31 PM
<form action="sendmail.php" method="post" id="commentform">

$author = $_GET['author'] ;
$email = $_GET['email'] ;
$url = $_GET['url'] ;
$message = $_GET['message'] ; How do you expect it to work?

djm0219
07-24-2008, 01:37 PM
It's also extremely dangerous to use form variables directly without checking them for validity (especially when creating mail).

Crispy
07-24-2008, 01:38 PM
Sorry I haven't really learnt php, this is really the first I've done and was trying to follow a tutorial :)

Crispy
07-24-2008, 01:44 PM
It was a tutorial using jquery to validate, in what was is it dangerous dave :)? is there bits i should delete from the html?

djm0219
07-24-2008, 02:21 PM
It was a tutorial using jquery to validate

What is jquery and what validation does it do (and of what)?


is there bits i should delete from the html?

Since you don't appear to be using the author, email or url form variables you probably don't need to ask for them in the first place. You might want to consider removing any HTML from the message variable unless you are expecting the message to include HTML.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum