|
|
Post a Project »
Find a Professional HTML Freelancer!
Find a Freelancer to help you with your HTML projects
| |
|
 |
|
|
|
11-26-2008, 01:25 PM
|
Best Way To Send Form?
|
Posts: 55
Name: Mike
|
Hi,
I'm wondering what's the best way to send a form. I have to do it, but should I make it so it sends all the form details to a table in MySQL or my email? Which would you recommend?
|
|
|
|
11-26-2008, 01:46 PM
|
Re: Best Way To Send Form?
|
Posts: 19
|
It really depends on what you're going to do with the data.
If all you want for example is a basic enquiry form where they can leave their telephone number or email so you can get back to them then an email would probably be most suitable as this is the easier method to set up.
If however, you're looking for something more complex and want to filter, log any of the information gathered; then I would suggest a database. This way, you can quickly and easily gather information such as how many leads in a given month or how many leads in a specific area, etc.
|
|
|
|
11-26-2008, 02:03 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
Quote:
Originally Posted by Limotek
It really depends on what you're going to do with the data.
If all you want for example is a basic enquiry form where they can leave their telephone number or email so you can get back to them then an email would probably be most suitable as this is the easier method to set up.
If however, you're looking for something more complex and want to filter, log any of the information gathered; then I would suggest a database. This way, you can quickly and easily gather information such as how many leads in a given month or how many leads in a specific area, etc.
|
OK, I just want the enquiry. But I have already tried: action="mailto:Myemail@email.com". And if they don't use outlook explorer/thunderbird/etc..., then it won't send. I just want it to automatically send to my email.
|
|
|
|
11-26-2008, 06:27 PM
|
Re: Best Way To Send Form?
|
Posts: 208
Name: alysha
|
For me the best way is to send the data to your email.
|
|
|
|
11-26-2008, 06:29 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
So how would I set it up so that when they press submit, that automatically happens?
|
|
|
|
11-26-2008, 06:52 PM
|
Re: Best Way To Send Form?
|
Posts: 457
Name: Randy
Location: Northern Wisconsin
|
To get around using the mailto you can use a php mail function. You don't really need to know php to use it, there are plenty of cut and paste forms out there. It basically works like this:
1. The client fills out the form.
2. The form is sent to a php page(like mail.php) where the form is validated.(Do NOT skip this step or you can have SERIOUS email injections from spammers. There is also javascript client side validation.)
3. This php page then sends the email to your specified email account.
Here is one tutorial:
http://www.thesitewizard.com/archive/feedbackphp.shtml
This is page just the basic php form function, be sure to follow ALL steps mentioned in the tutorial.
The cool thing is, once you get this nailed down, you can customize this template for all your sites easily. But do read as much as you can about security issues of php mailing.
Hope this answers your question.
|
|
|
|
11-26-2008, 07:41 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
Thanks for the help, but I don't think it worked.
PHP Code:
<?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $maskcolor = $_REQUEST['maskcolor'] ; $masktype = $_REQUEST['masktype'] ; $highlight = $_REQUEST['highlight'] ; $visorcheck = $_REQUEST['visorcheck'] ; $rightstripe = $_REQUEST['rightstripe'] ; $rightcolor = $_REQUEST['rightcolor'] ; $middlestripe = $_REQUEST['middlestripe'] ; $middlecolor = $_REQUEST['middlecolor'] ; $leftstripe = $_REQUEST['leftstripe'] ; $leftcolor = $_REQUEST['leftcolor'] ; $decal = $_REQUEST['decal'] ; $colorhelmet = $_REQUEST['colorhelmet'] ; $base = $_REQUEST['base'] ; $logourl = $_REQUEST['logourl'] ; $message = "$name , $email , $maskcolor , $masktype , $highlight , $visorcheck , $rightstripe , $rightcolor , $middlestripe , $middlecolor , $leftstripe , $leftcolor , $decal , $colorhelmet , $base , $logourl"; mail( "My Email was here", "Form Results", $message, "From: $email" ); header( "Location: home.html" );
|
|
|
|
11-28-2008, 10:50 AM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
Are we allowed to Bump?
|
|
|
|
11-28-2008, 12:01 PM
|
Re: Best Way To Send Form?
|
Posts: 457
Name: Randy
Location: Northern Wisconsin
|
Did you close this php page?
?>
I use this all the time, it should work assuming your server has php installed.
I am sure if you search the php section here, you'd get help for a form as well.
|
|
|
|
11-28-2008, 06:38 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
Yeah, PHP is installed. And yes, it did get closed. I don't know, I'm just so confused at how this works.
PHP Code:
<?php $name = $_REQUEST['name']; $email = $_REQUEST['email'] ; $maskcolor = $_REQUEST['maskcolor'] ; $masktype = $_REQUEST['masktype'] ; $highlight = $_REQUEST['highlight'] ; $visorcheck = $_REQUEST['visorcheck'] ; $rightstripe = $_REQUEST['rightstripe'] ; $rightcolor = $_REQUEST['rightcolor'] ; $middlestripe = $_REQUEST['middlestripe'] ; $middlecolor = $_REQUEST['middlecolor'] ; $leftstripe = $_REQUEST['leftstripe'] ; $leftcolor = $_REQUEST['leftcolor'] ; $decal = $_REQUEST['decal'] ; $colorhelmet = $_REQUEST['colorhelmet'] ; $base = $_REQUEST['base'] ; $logourl = $_REQUEST['logourl'] ; $message = "$name , $email , $maskcolor , $masktype , $highlight , $visorcheck , $rightstripe , $rightcolor , $middlestripe , $middlecolor , $leftstripe , $leftcolor , $decal , $colorhelmet , $base , $logourl"; mail( "**@**.***", "Form Results", $message, "From: $email" ); header( "Location: index.html" ); ?>
Last edited by HWolfpack6; 11-28-2008 at 06:47 PM..
|
|
|
|
11-28-2008, 06:59 PM
|
Re: Best Way To Send Form?
|
Posts: 42
Name: Norman
Location: [Italy]
|
Did you get a PHP error or what?
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Please login or register to view this content. Registration is FREE
|
|
|
|
11-28-2008, 07:01 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
OK here's a good question. Do I need SMTP for this? I'm testing it on my computer for now.
|
|
|
|
11-28-2008, 07:20 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
PHP Code:
<?php if(isset($_POST['submit'])) {
$to = "MyEmail@whocares.com"; $subject = "Form for Helmets"; $name_field = $_POST['name']; $email_field = $_POST['email']; $maskcolor_field = $_POST['maskcolor'] $masktype_field = $_POST['masktype'] $highlight_field = $_POST['highlight'] $visorcheck_field = $_POST['visorcheck'] $rightstripe_field = $_POST['righstripe'] $rightcolor_field = $_POST['rightcolor'] $middlestripe_field = $_POST['middlestripe'] $middlecolor_field = $_POST['middlecolor'] $leftstripe_field = $_POST['leftstripe'] $leftcolor_field = $_POST['leftcolor'] $decal_field = $_POST['decal'] $colorhelmet_field = $_POST['colorhelmet'] $base_field = $_POST['base'] $logourl_field = $_POST['logourl'] $message = $_POST['name']; $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message"; echo "Data has been submitted to $to!"; mail($to, $subject, $body);
} else {
echo "blarg!";
} ?>
I don't get it. It just sends the page to the mailer.php when submit is clicked. And then I don't receive any email at all. Is it because I don't have SMTP?
|
|
|
|
11-29-2008, 03:36 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
Parse error: parse error, unexpected T_VARIABLE in /home/www/footballhelmets.freehostia.com/mailer.php on line 9
EDIT: I got it to submit, but still haven't received the email yet, how long should I give it? It's only text.
Last edited by HWolfpack6; 11-29-2008 at 03:38 PM..
|
|
|
|
11-29-2008, 08:09 PM
|
Re: Best Way To Send Form?
|
Posts: 923
Name: Geoff Vader
Location: In my dreams
|
Quote:
Originally Posted by alysha
For me the best way is to send the data to your email.
|
On 1and1 the world's leading host, according to itself, I've seen times where there is bad service, sometimes an email actually doesn't get sent, other times the website hosted there is down.
Also when i compare the access logs of that to the ones of my linux server i note that 1and1 actually loses at least 20% of inbound clicks from the log, who knows what else they lose.
To my annoyance inbound quote requests to the site on 1and1 (the management ignorantly insists) all go as email only - the form is filled and the data is emailed. NO COPY IS KEPT ON THE SERVER - which means if the email is one that gets lost in transit (it happens, i know - we even had a complaint once) no one will ever know!
Back things up always. And always keep copies of submitted form data. Any other way is moronic. Take it from a veteran.
|
|
|
|
11-29-2008, 08:12 PM
|
Re: Best Way To Send Form?
|
Posts: 923
Name: Geoff Vader
Location: In my dreams
|
Quote:
Originally Posted by HWolfpack6
OK here's a good question. Do I need SMTP for this? I'm testing it on my computer for now.
|
That's right, you can't normally expect mail-sending scripts (designed to run on your server) to send mail from the desktop of a home computer! Not unless you've got a server inside THAT, and even then, if your ISP hasn't specifically been sanctioned by you to do that, it won't work anyway, server or not.
It's a good thing really, because it's the last defence against people hijacking machines on the sly and using them to send 8 billion spam messages a second.
|
|
|
|
11-29-2008, 08:41 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
Darn. My host (freehostia) doesn't let me use SMTP 
|
|
|
|
11-29-2008, 09:02 PM
|
Re: Best Way To Send Form?
|
Posts: 923
Name: Geoff Vader
Location: In my dreams
|
The best things in life may be free, but not on the web! Paid hosting is NOT very expensive. Still, i bet you if you get a free page at lycos, they'll let you use smtp
Last edited by witnesstheday; 11-29-2008 at 09:04 PM..
Reason: removed gratuitous sales pitch
|
|
|
|
11-29-2008, 09:07 PM
|
Re: Best Way To Send Form?
|
Posts: 55
Name: Mike
|
Already signed up for free-hosts.net.
But thanks for your help!
|
|
|
|
11-30-2008, 08:01 AM
|
Re: Best Way To Send Form?
|
Posts: 5
Name: Edy Galantzan
|
By email it easier to program.
__________________
Edy
Web Pro
|
|
|
|
|
« Reply to Best Way To Send Form?
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|