PDA

View Full Version : Email link in forms


Matelot
05-27-2009, 11:46 PM
Hello,
I'm using Dreamweaver MX 2004. Following the steps laid down in Janine Warner's book "Dreamweaver MX for Dummies" (appropriate for me) I have created a form that looks pretty good. I have created three buttons "Clear", "Cancel" and "Submit". In Properties I have entered my "mailto: etc" but the moment I navigate away from it it clears. This is the code that Dreamweaver has generated - <input name="Submit" type="Submit" value="Submit" />

That's the preamble - how do I get it to work?

Next Question. I've also created a "Thank You" page. How do I arrange for that to come up when the Email has been sent?

Thank You!!!

DWcourse
05-28-2009, 12:02 AM
You need some sort of script (php, etc. that isn't part of Dreamweaver) to convert your form content into an email. The same script should be able to redirect to a thank you page.

dubaco
05-28-2009, 02:37 PM
It doesn't get much easier than this one:

http://www.dreamweaverclub.com/dreamweaver-php-form.php

I use it, it's very basic but does the basics.

If it would send an email confirmation to the form fillers email then that would be nice but it does all `i need and you can add more fields easily.

d

DWcourse
05-28-2009, 03:38 PM
I use a commercial program, Forms To Go (http://www.bebosoft.com/products/formstogo/index.php) to generate my scripts. It offers support for PHP, ASP and Perl, can send emails (html and/or text), write to a database, send an autoresponse, redirect to a thank you, etc., etc.

I recommend it if you're willing to shell out $30 to $70 (depending upon the version).

Matelot
05-28-2009, 04:24 PM
Thank you both. I think I gather the gist of the PHP code and where I have to amend it to make it relevant to my site, e.g., the email address. So how do I create this "sendresults.php file in which I paste the code?

Corrosive
05-28-2009, 04:33 PM
Thank you both. I think I gather the gist of the PHP code and where I have to amend it to make it relevant to my site, e.g., the email address. So how do I create this "sendresults.php file in which I paste the code?

In DW. > new dynamic page, php.

edbr
05-29-2009, 12:57 AM
dubaco try this (keep original i havent tested it but it should do the job)
<?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 = 'mail@rdsnetworks.net';

////// added ///////////////////

$emailadd2 = $POST_['email']; // form must have field named email or change to suit
$text2 = "add the message you want to the sender here"; // change text between the " "

////// added ///////////////////////// added /////////////////////////


// Where to redirect after form is processed.

$url = 'http://www.rdsnetworks.net/confirmation.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.'');


////// added ///////////////////
mail($emailadd2, $subject, $text2);

////// added ///////////////////
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

Matelot
06-03-2009, 04:39 PM
Hell all,
Once again I thank you for your help and advice.
I've used the first code that was posted. When I preview it in the browser it looks good but nothing arrives in my emails. I wonder if I must now say something to my web host One.com about php? I've not added any links to other pages yet as I don't want people trying to send emails to me that don't go anywhere. So although the pages have been "put" you can't find them.

Once more.
Thanks

Matelot
06-03-2009, 04:41 PM
The previous post should begin Hello all NOT Hell all - Sorry