Log in

View Full Version : Forms



chrisgocrazyH
05-01-2008, 11:51 AM
Hello i did a form Email me form and when i hit submit it opens out look it dosent just send it, It would open a new Message thats blank


<form action="mailto:[email protected]" method="get" enctype="text/plain">
Name*<br>
<input type="text" name="name" id="name" size="30" style="color: #FFFFFF; font-family: Trebuchet MS; border: 1px solid #FFFFFF; background-color: #131313" /><br>
What Job*<br>
<select name="rating" id="rating" style="font-family: Trebuchet MS; color: #FFFFFF; border: 1px solid #FFFFFF; background-color: #131313" size="1"><br>
<option>Options:</option>
<option>DJ</option>
<option>Radio manager</option>
<option>Alterations Artists</option>
<option>News Reporter</option>
<option>News Manager</option>
<option>Content Manager</option>
<option selected>Pick a Job Please</option>
</select><br>
Why*<br>
<textarea name="improve" id="improve" rows="4" cols="46" style="color: #FFFFFF; font-family: Trebuchet MS; border: 1px solid #FFFFFF; background-color: #131313"></textarea><br>
<input type="submit" value="Send Feedback" style="border: 1px solid #FFFFFF; background-color: #C0C0C0" />
</form

Moved by Agesilaus (Forum Moderator) from Designing and Development: Please post in the correct forum next time. :)

Jme
05-01-2008, 04:28 PM
You need to use php to send it to the pop server and deliver the email.


<?php
if(isset($_POST['send']))
//send would be the name of your submit button..
{
$name = $_POST['name'];
//The name field..
$job = $_POST['job'];
//The choose job dropdown.
$improve = $_POST['improve'];
//The improve textarea
if(!isset($name) || !isset($job) || !isset($improve))
{
echo("Fields left blank..");
}
else
{
$to = "[email protected]";
$subject = "Contact form submission from " . $name . "..";
$msg = "" . $name . " has contacted you about the " . $job . " job opening. He left the following message..\n\n" . $msg . "";
mail("$to", "$subject", "$msg");
}
}
else
{
echo("Your form..");
}
?>

That should work, take out the form action and name your job option as job and your submit button as send.

MrCraig
05-01-2008, 04:32 PM
:S a bit unclean..

Jme
05-01-2008, 04:35 PM
I don't see how it's unclean but oh well, it was only an example of how it would be done..

chrisgocrazyH
05-01-2008, 04:41 PM
ty :) worked

MrCraig
05-01-2008, 05:37 PM
I don't see how it's unclean but oh well, it was only an example of how it would be done..

You havent cleaned anything ... :rolleyes:

Eg


$name = $_POST[name];

Hitman
05-01-2008, 05:59 PM
You havent cleaned anything ... :rolleyes:

Eg


$name = $_POST[name];

I think JME is thinking you meant it's not tidy.

If there are exploits to POP servers (or whatever he's sending to) with web forms, good idea to clean the forms, but I don't know if there are.

Jme
05-01-2008, 08:21 PM
I think JME is thinking you meant it's not tidy.

If there are exploits to POP servers (or whatever he's sending to) with web forms, good idea to clean the forms, but I don't know if there are.

Ohhh, i see I didn't see the point to clean the input because it can't effect the pop server. If i was inserting it into a database then there would be a point to cleaning the input.

Invent
05-01-2008, 10:17 PM
Yes it's unsecure.

Remove \n and \r from inputs.

MrCraig
05-01-2008, 10:44 PM
Someone might find a way..

better to be safe than sorry.

Want to hide these adverts? Register an account for free!