08-05-2007, 09:10 PM
I need to make a form where it requires all information to be filled in. I can write up all the questions needed, but I just need to get the boxes where it's entered and figure out a few other things. I need to know the html/css codes for it, and I also need to find out how to access the information once it's filled out. Is there a way I can get it emailed to me once they fill it out? Does it go to my hosting company for me to check out? Please inform me and help me find a site or code that will work for me. Thanks guys.
08-05-2007, 09:18 PM
For a form to be processed you need a server side script like ASP, PHP, or the like. The plain HTML for it is relatively simple. Just search for “form HTML” or something like that. Google is your friend. Or actually, this is a nice article: http://www.alistapart.com/articles/prettyaccessibleforms
There are also free form mailer scripts (the server side scripts that are processing the form input) of which you will find hundreds if you’d just do a search.
08-05-2007, 09:24 PM
That site seems to be exactly what I needed. That's why I ask these questions. Although I try googling I don't always find the quality content that I'm looking for, and members here may have some good experience with a certain site/tutorial. Good article. +rep!
08-05-2007, 10:43 PM
I use this PHP script for mailforms (placed in a file called mailform.php):
if (!empty($_POST['name']) &&
!strpos($_POST['name'], "your-domain.com") &&
!strpos($_POST['email'], "your-domain.com") &&
!strpos($_POST['name'], "@") &&
$headers .= "\r\nBcc: ".$_POST['email'];
if (@mail("firstname.lastname@example.org", strip_tags($_POST['subject']),
echo "<p>Thanks for your mail!</p>";
echo "<p>The e-mail was not sent! Please try again.</p>";
echo "<p>The e-mail could not be sent. All fields must be filled out.</p>";
<form method="post" action="mailform.php">
<input id="t1" type="text" name="name"><br><br>
<input id="t2" type="text" name="email"><br><br>
<input id="t3" type="text" name="subject"><br><br>
<textarea id="t4" name="message" rows="10" cols="49"></textarea><br>
<label>If checked, a copy will be sent to your inbox</label>
<input type="checkbox" id="t5" name="customer_copy" checked="checked"><br><br>
<input id="t6" type="submit" name="submit" value="Send e-mail"></div>
The good thing about it is that you give the user the option to send a copy to his inbox. The other good thing, well... it can send mails. :p
08-06-2007, 03:06 AM
Thanks alot jutlander! I have a question though. If I wanted to add an extra question how would I do that?
My guess from looking at the code is this
!eregi("\r",$_POST['NEW QUESTION HERE']) &&
That looks to be correct to me, but I'm not sure. Also would I have to add something to the bottom part?
08-06-2007, 07:45 AM
Will try to figure out how to do that, just need a few more hours sleep, got too late yesterday.. :o
08-06-2007, 09:30 AM
The good thing about it is that you give the user the option to send a copy to his inbox.
One may argue that this is actually a weakness of the form. I think spammers will love this form. :rolleyes:
08-06-2007, 06:53 PM
His as in his own email address? I'm not so sure what you mean by spammers. I'm fine with the amount of emails I'll be getting.
08-06-2007, 07:46 PM
I think he means that spammers can make good use of this form, because they can write in another e-mail address and in that way, send spam to both you and the other e-mail. I like to keep a copy of the mails I send though...
08-06-2007, 09:13 PM
Oh, well I don't really mind. If it gets to bad I could change it, but I don't think I'll be getting to many spam type sign ups, I hope.
Anyways about adding another question...?