Need Help on a Form

secretply

New Member
Messages
50
Reaction score
0
Points
0
I currently have a form that I have coded in and now need some further help to finish the form. I have here the code that I created for use in my form:

Code:
<form action="sendmistakes.php" method="post"><div class="div17">First Name: <input name="firstname" tabindex="1" size="5" /> Last Name: <input name="lastname" tabindex="2" size="5" /><br /><br />Select Mistake: <select tabindex="3" name="selectmistake"><option value="brokenimages">Broken Images</option><option value="brokenlinks">Broken Links</option><option value="grammarerrors">Grammar Errors</option><option value="spellingerrors">Spelling Errors</option><option value="other">Other</option></select><br /><br />Explain Mistake:<br /><textarea tabindex="4" class="textarea1" name="explainmistake" cols="30" rows="5"></textarea><br /><br /><input tabindex="5" type="submit" value="Submit Form" /> <input tabindex="6" type="reset" value="Reset Form" /></div></form>

I currently have nothing coded for sendmistakes.php because I don't know how to finish it off. What I'm trying to do is finish the form when the viewer clicks "Submit Form" to send me an email with the information inputted then a little message that appears (in the same page) to show the user that the form has been submitted correctly, preferably before the beginning of the form. I have never coded in PHP before and I can somewhat understand it but not fully. The person who can help me finish it off and can make it work will receive 175 credits, MINIMUM. I might donate a bit more but 175 credits guaranteed. Thank you.
 

Scoochi2

New Member
Messages
185
Reaction score
0
Points
0
There are two quick links I can give you here.

http://www.tele-pro.co.uk/scripts/contact_form/
This first one will create the PHP form for you (and does other languages as well, you choose), and you just have to upload it to your hosting.

http://www.emailmeform.com/
This second one will submit your form data to their website, and they will email you. However, you have to sign up for this service, although it is free.


Both of those should be ok for you. However, I would recommend trying the first and studying the code to see what it is doing and how it works. Especially if you are wanting to learn more about PHP or wish to use it in the future.
 

secretply

New Member
Messages
50
Reaction score
0
Points
0
I don't prefer those automatic form generators because you can't design them and customize the layout to your need.
 

falconeye3000

New Member
Messages
2
Reaction score
0
Points
0
well i dont speak english very well so you try read jejejeje

you need declarate in the sendmistakes.php the variables someting like this can work:

// Configuration Settings
$SendFrom = "info info[EMAIL="info@yourm"]@yourdomain.com[/EMAIL]"; // email sender
$SendTo = youremailhere@yourdomain.com;
$SubjectLine = "subjet in the mail"; // you can chage this
$ThanksURL = "thanks.htm"; //confirmation page
//dont modify
// Build Message Body from Web Form Input
foreach ($_POST as $Field=>$Value)
$MsgBody .= "$Field: $Value\n";
$MsgBody .= "\n" . @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\n" .
$_SERVER["HTTP_USER_AGENT"];
$MsgBody = htmlspecialchars($MsgBody, ENT_NOQUOTES); //make content safe
// Send E-Mail and Direct Browser to Confirmation Page
mail($SendTo, $SubjectLine, $MsgBody, "From: $SendFrom");
header("Location: $ThanksURL");
?>

good luck from mexico jejeje
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
You could try this approach..

Your first page don't need altering.

In your sendmistakes.php file, you just need to set your headers and then insert the values from the post.

You could do with capturing their e-mail address in your form.

i.e.

PHP:
$toemail="youremail@address.com";

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n"; 
$headers .= 'From: <'.$_POST['fromemail'].'>' . "\r\n";
$headers .= 'Reply-To: '.$_POST['fromemail']."\r\n";
$headers .= 'X-Mailers: PHP /'.phpversion() . "\r\n";
$subject = 'Posted mistakes';
$message = '

mistake:'.$_POST['mistake'].'<br/>

explanation:'.$_POST['whateverfield'].'<br/>

etc. etc.....


';

if (@mail($toemail,stripslashes($subject),stripslashes($message),stripslashes($headers)))
{
	echo "Mail to:".$toemail." confirmed.</br>";
}
else
{
	echo "Mail to".$toemail." failed.  Please try again.</br>";
}
 
Top