FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Anyone know how to make an email form?

 


Satori
So I'm looking to have a form on my website where people can fill in their name, email address, and a message and click a send button and have an email sent to me without disclosing my email address.

Anyone know how to do this? Can it be done with just html? Or is this something that needs java or some other script language?

Please help me out here! I really would like to not have my email hanging out on my website, but part of the reason I have the site is so people can contact me through it. Just trying to avoid the spam!

Thanks in advance to anyone who can help
selim06
Quote:
Description: FORMgen is a wizard that allows you to create Mortgage, Housing, Survey, and Contact Us forms without programming a thing. Within minutes you can create your own Loan Application Form, Contact Us Form, Survey, etc... that sends the results to an email account and database. FORMgen is great for people with no programming experience or for experienced programmers who need a starting point for creating more elaborate forms. Step 1: Enter a form name. Step 2: Create the fields. Step 3: Pick a CSS template. Step 4: Set the form actions. Step 5: Download your form. Please note: you must purchase a copy of the FORMfields Library and install it on your web server to power a form generated by FORMgen. Furthermore, FORMgen is free to use on www.formfields.com, however you can purchase a commerical version that can be installed on your local web server.

It's a form creator so you can create E-mail forms it's so easy if you want to try it:
http://www.formfields.com/FORMgenArea/index.php
and it's FREE!
venkateshwarans
You have many such scripts at www.hotscripts.com. Try category - php/form processors
wumingsden
selim06 wrote:
Quote:
Description: FORMgen is a wizard that allows you to create Mortgage, Housing, Survey, and Contact Us forms without programming a thing. Within minutes you can create your own Loan Application Form, Contact Us Form, Survey, etc... that sends the results to an email account and database. FORMgen is great for people with no programming experience or for experienced programmers who need a starting point for creating more elaborate forms. Step 1: Enter a form name. Step 2: Create the fields. Step 3: Pick a CSS template. Step 4: Set the form actions. Step 5: Download your form. Please note: you must purchase a copy of the FORMfields Library and install it on your web server to power a form generated by FORMgen. Furthermore, FORMgen is free to use on www.formfields.com, however you can purchase a commerical version that can be installed on your local web server.

It's a form creator so you can create E-mail forms it's so easy if you want to try it:
http://www.formfields.com/FORMgenArea/index.php
and it's FREE!




Its free to create a form but to be able to use it on your site you have to purcahse a scripts. I think it costs around $12


Save the following file as *something.php and edit the lines which has comments "(//):

Code:
<?php

$to = "you@yoursite.com"; //Change to your e-mail address
$subject = "Feedback"; //Change to the subject of the emails you will get

if(isset($_POST['message']))
 {
 $msg = $_POST['message'];
 $email = $_POST['email'];
 $name = $_POST['name'];
 mail($to, $subject, $msg);
 }

$thisdoc = $_SERVER['PHP_SELF'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Contact Form</title>
</head>

<body>

<?php

if(!isset($_POST['message']))
 {
 print "<form action=\"$thisdoc\" method=\"post\">\n\n";
 print "Your name:<br />\n";
 print "<input type=\"text\" size=\"60\" name=\"name\"><br /><br />";
 print "Your e-mail address:<br />\n";
 print "<input type=\"text\" size=\"60\" name=\"email\"><br /><br />";
 print "Your message:<br />\n";
 print "<textarea name=\"message\" cols=\"60\" rows=\"4\">";
 print "</textarea><br /><br />";
 print "<input type=\"submit\" value=\"Send!\">";
 }

else if(isset($_POST['message']))
 {
 print "Thank you for your input!<br /><br />";
 print "Your message will be recieved shortly";
 }

?>

</body>
</html>


Script from http://www.frihost.com/forums/vt-40956.html
venc
if you need email forms, try formbuddy.com, the provide free email forms
Satori
wumingsden wrote:

Save the following file as *something.php and edit the lines which has comments "(//):

Code:
<?php

$to = "you@yoursite.com"; //Change to your e-mail address
$subject = "Feedback"; //Change to the subject of the emails you will get

if(isset($_POST['message']))
 {
 $msg = $_POST['message'];
 $email = $_POST['email'];
 $name = $_POST['name'];
 mail($to, $subject, $msg);
 }

$thisdoc = $_SERVER['PHP_SELF'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Contact Form</title>
</head>

<body>

<?php

if(!isset($_POST['message']))
 {
 print "<form action=\"$thisdoc\" method=\"post\">\n\n";
 print "Your name:<br />\n";
 print "<input type=\"text\" size=\"60\" name=\"name\"><br /><br />";
 print "Your e-mail address:<br />\n";
 print "<input type=\"text\" size=\"60\" name=\"email\"><br /><br />";
 print "Your message:<br />\n";
 print "<textarea name=\"message\" cols=\"60\" rows=\"4\">";
 print "</textarea><br /><br />";
 print "<input type=\"submit\" value=\"Send!\">";
 }

else if(isset($_POST['message']))
 {
 print "Thank you for your input!<br /><br />";
 print "Your message will be recieved shortly";
 }

?>

</body>
</html>


Script from http://www.frihost.com/forums/vt-40956.html

I tried this out...but with no luck. Ofcourse...once I save it as a php document, then what do I do with it?? My html editor doesn't recognize php I suppose? And I definitely don't know php myself...so could you give me some more info please?

Thanks!
wumingsden
You can use any HTML editor I think. I use notepad, wordpad can also be used as well as lots of other programs. At frist this program may not recognise it so use the "open with..." option and set notepad as the default application. If the code is all messed up it means that it was created in WordPad so you will need to use this to edit a php file.

I've PM'ed you.
Satori
So I'm still looking for a way to do this.

If you give me code that works...please explain how to implement it as well. If it's just html, I can figure it out...but when it comes to php or javascript, I don't know either of those...so I don't know how to implement them either. Anyone? Anyone at all?

Thanks
bladesage
Satori wrote:
So I'm still looking for a way to do this.

If you give me code that works...please explain how to implement it as well. If it's just html, I can figure it out...but when it comes to php or javascript, I don't know either of those...so I don't know how to implement them either. Anyone? Anyone at all?

Thanks


If you need something to send you raw data, excluding files, use the following form opening tag:
Code:
<form action="mailto:you@yourplace.com" enctype="text/plain" method="post">


Then, for all your textareas, add the following attribute:
Code:
wrap="hard"


For example:
Code:
<textarea name="name" cols="60" rows="4" wrap="hard"></textarea>


And I'm sorry my form script above didn't help you Crying or Very sad. It worked just fine for the other person. What happens with it that doesn't work? Does it make error warnings, or do you just not get the email?

EDIT: If you prefer a cleaner looking email, I can make you a custom form handling script, one with the form itself being a seperate HTML page. Real easy, just let me know Wink
Satori
bladesage wrote:

If you need something to send you raw data, excluding files, use the following form opening tag:
Code:
<form action="mailto:you@yourplace.com" enctype="text/plain" method="post">


Then, for all your textareas, add the following attribute:
Code:
wrap="hard"


For example:
Code:
<textarea name="name" cols="60" rows="4" wrap="hard"></textarea>


And I'm sorry my form script above didn't help you Crying or Very sad. It worked just fine for the other person. What happens with it that doesn't work? Does it make error warnings, or do you just not get the email?

EDIT: If you prefer a cleaner looking email, I can make you a custom form handling script, one with the form itself being a seperate HTML page. Real easy, just let me know Wink

Bladesage - I'm sure your script works just fine...I'm just an idiot and don't know how to use php. I was looking for a form that I could put into an html page where someone could type an email in the form boxes and click send and I'd get it sent to me without them knowing my email address. Wumingsden helped me out. I didn't know how php worked, so I didn't know how to use your script. But I've got it all figured out now.

Thanks again for your help!
bladesage
Oh wait, there's a flaw in my script! That's what they were trying to tell me! I'm glad everything worked out for you.
bladesage
Okay, sorry people!

In case anyone here is still interested, here's my revised code
Code:
<?php

$to = "you@yoursite.com"; //Change to your e-mail address
$subject = "Feedback"; //Change to the subject of the emails you will get

if(isset($_POST['message']))
 {
 $email = $_POST['email'];
 $name = $_POST['name'];
 $msg = "This is a response from one of your visitors.\n\n";
 $msg .= "Email:\n$email\n\nName:\n$name\n\n";
 $message = $_POST['message'];
 $msg .= "Message:\n$message";
 mail($to, $subject, $msg);
 }

$thisdoc = $_SERVER['PHP_SELF'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Contact form</title>
</head>

<body>

<?php

if(!isset($_POST['message']))
 {
 print "<form action=\"$thisdoc\" method=\"post\">\n\n";
 print "Your name:<br />\n";
 print "<input type=\"text\" size=\"60\" name=\"name\"><br /><br />";
 print "Your e-mail address:<br />\n";
 print "<input type=\"text\" size=\"60\" name=\"email\"><br /><br />";
 print "Your message:<br />\n";
 print "<textarea name=\"message\" cols=\"60\" rows=\"4\">";
 print "</textarea><br /><br />";
 print "<input type=\"submit\" value=\"Send!\">";
 }

else if(isset($_POST['message']))
 {
 print "Thank you for your input!<br /><br />";
 print "Your message will be recieved shortly";
 }

?>

</body>
</html>
Possum
Hi

Is there a way that you can go to another web page after the user uses this form to send mail..



thx great code.. I will use this..
wumingsden
Possum wrote:
Hi

Is there a way that you can go to another web page after the user uses this form to send mail..



thx great code.. I will use this..


Quote:
<input type="hidden" name="sent_page" value="http://www.yourdomain.com/success.html">


Change where appropiate
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.