PDA

View Full Version : submit form?


Trés Juicy
02-04-2010, 10:05 AM
Hi guys, I'm having trouble with submitting forms via email and wondered if anyone could help....

My first problem is that when you click submit Outlook is required to send any information, which sort of defeats the object of the form!! How can I get round this?

My second problem is that when Outlook sends the form info it reads:

textfield=John
textfield2=Smith
textfield3=123 Test Street
textfield4=Somewhere
textfield5=Example Town
textfield6=FT9 0DR
textfield7=04565286532
checkbox=checkbox
checkbox2=checkbox
Submit=Submit

Which is obviously not what I want it to say, do I need to rename the fields?

Can anyone help me?

edbr
02-04-2010, 10:38 AM
you need a mail processing script . there is a php script on this forum. if you are using outlook then im guessing tou are using mailto which isnt a good idea.
check the tutorials for the script and instructions

Trés Juicy
02-05-2010, 08:17 AM
you need a mail processing script . there is a php script on this forum. if you are using outlook then im guessing tou are using mailto which isnt a good idea.
check the tutorials for the script and instructions

Thanks, I'm fairly new to DW.

What do I do with the PHP script and why is it a bad idea to use mailto:?

edbr
02-05-2010, 08:28 AM
the action of a form must be 'pointed ' to the form so t can be processed.
re mailto it will open the user mail client which is not always appreciated and it will also leave on your page your email address (even if only in your code) which can then be collected and added to lists for spamming and worse

gentleone
02-05-2010, 08:34 AM
Thanks, I'm fairly new to DW.

What do I do with the PHP script and why is it a bad idea to use mailto:?

You need the PHP file to send the form and this file need to be on your server as long as your web hosting has PHP installed on the server. A good web hosting has it standard on its servers, but it if you have a free hosting then likely there is no PHP included on their servers. So check this with your hosting.

It's a bad idea to use mailto for security reasons that your e-mail address is wide open in the source code so its easy for spambots to harvest your email address. For usability reason if a user click on submit then their default email client such as Outlook will open to send the mail, but if a user don't have such an email client and uses hotmail or gmail then they can't send you a message.

gentleone
02-05-2010, 08:37 AM
it's always better to get double advise then none :)

AnnaGirl2010
02-06-2010, 06:12 AM
I use this currently - and yes, no CAPTCHA but I'm not building sites for Wal-Mart sized companies.

http://www.freecontactform.com/email_form.php

so easy to setup and use - works GREAT.

only problem is getting it to "sit" in my layout...grrrrrr!

Trés Juicy
02-06-2010, 06:12 PM
it's always better to get double advise then none :)

Thanks, any idea where or how I can get a php file? and once I have one what do I do with it?

domedia
02-06-2010, 06:56 PM
Open your text editor and a document as whatever.php and you have a php page, not rocket science really ;)
Click on 'Tutorials and Articles' on top of this page, the main nav, and you'll find a list of php tutorials.

gigiloumill
02-10-2010, 02:56 PM
Here you go. Use as long as your server does not require a SMTP set up.

<?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Results from Contact form';

// Your email address. This is where the form information will be sent.
$emailadd = 'email@yourname.com';

// Where to redirect after form is processed.
$url = 'http://www.yourpage.com/index.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>


Good luck