Dreamweaver forms to email/excel

  lonemascot 18:16 08 Mar 2010

I'm a web design novice, please consider this when replying.

I have a website click here with a very simple contact form using a pre made PHP script which i part customised with extra fields etc. This works fine.

First and foremeost, I want to create a second form so that potential customers could fill out measurements of their roof for me to quote on works. I have created the form in dreamweaver CS4 and it includes radio buttons and checkboxes some of which have spry validations attached to them. Upon submittal the info gets sent to my email as a postdata.att file which is readable in DW and includes all the relevant info but is a pain to see whats what as there is code around all the field entries.

Secondly as an after thought, I would use this data and input the measurements manually into an Excel worksheet that I have created that carries out calculations to give an end price. I would like to know if its possible to make a form that sends all of the customers entries into the correct areas of this worksheet to automatically work out the price.

Does anyone know of a free PHP extension or wizard that can create code for me or an extensive PHP tutorial which I can teach myself how to understand the gobble de gook.

Thanks guys

  lonemascot 20:26 08 Mar 2010

Thanks for the compliment. I think I have cracked it anyway. I used a different script:

//--------------------------Set these paramaters--------------------------

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

// Your email address. This is where the form information will be sent.
$emailadd = '[email protected]';

// Where to redirect after form is processed.
$url = 'click here';

// 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.'">';

I just created the form in DW with all the bits and bobs that I wanted, pointed it to the new PHP file I created and uploaded it to a testing server. Seems to have done the trick but have a few bits and bobs that need ironing out such as menu labels etc.

You are right about Excel. It is isn't a great deal of work to manually input the info and it would be a good idea to validate it myself. I do have a disclaimer in place stating that the quote only serves as a guide until I can carry out a proper site survey.

Thanks for your input.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Honor 9 Lite review

How Sam Falconer transforms science and geology into digestible, elegant illustrations

HomePod review

Les meilleures séries Netflix (2018)