Building a website......A few Qs....Help please
Building a website......A few Qs....Help please
Author
Discussion

master yoghurt

Original Poster:

3,636 posts

283 months

Friday 15th July 2005
quotequote all
Hello all

I am building a web site but need to put a quote page in it. The page should be editable from the site by the person wanting the quote. Also the page need to be emailed to me by clicking a button and all the info entered when the site is left. Below is what I would like on it. Any Idea's


QUOTE
Please fill out the form below and a member of our staff will contact you shortly to arrange a quotation.




Name:

Company:

Phone:

Fax:

E-Mail:

Address:

City:

Post Code:


When are you looking to have the work carried out?:
Now - Radio buttons
Within the next month
Within the next 6 months
Within the next year




Brief description of the work required:

Text box

Optional Description or Comments:

Text Box


Thanks in advance

Dave



JoolzB

3,549 posts

279 months

Friday 15th July 2005
quotequote all
You'll need a host that allows some server side code to run, asp, php etc. You'll also need to store the content off somewhere, a database, text file etc.

docevi1

10,430 posts

278 months

Friday 15th July 2005
quotequote all
save this as a file "contact.php" and in theory it should work.

not the best way to do it by any means, but it gives you an idea of what is needed.

-------------
<?PHP
$myEmail = "someone@somewhere.com";
$mySubject = "Website Quote";


if(isSet($_GET['submit'])
{
$headers = 'From: ' .$_POST['email']. " " .
'Reply-To: '.$_POST['email'] . " " .
'X-Mailer: PHP/' . phpversion();
$message = wordwrap($_POST['name']."/n"
.$_POST['company']."/n"
.$_POST['phone']."/n"
.$_POST['fax']."/n"
.$_POST['email']."/n"
.$_POST['address']."/n"
.$_POST['city']."/n"
.$_POST['postCode']."/n"
.$_POST['radio1']."/n"
.$_POST['description']."/n"
.$_POST['optional']."/n", 70);

mail($myEmail, $mySubject, $message, $headers);
}
?>
<html>

<head>
</head>

<body>
<form method="POST" action="contact.php?submit=true">
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="50%">Name:</td>
<td width="50%"><input type="text" name="name" size="20"></td>
</tr>
<tr>
<td width="50%">Company: </td>
<td width="50%"><input type="text" name="company" size="20"></td>
</tr>
<tr>
<td width="50%">Phone: </td>
<td width="50%"><input type="text" name="phone" size="20"></td>
</tr>
<tr>
<td width="50%">Fax: </td>
<td width="50%"><input type="text" name="fax" size="20"></td>
</tr>
<tr>
<td width="50%">E-Mail: </td>
<td width="50%"><input type="text" name="email" size="20"></td>
</tr>
<tr>
<td width="50%">Address:</td>
<td width="50%"><textarea rows="2" name="address" cols="20"></textarea></td>
</tr>
<tr>
<td width="50%">City: </td>
<td width="50%"><input type="text" col="20" name="city" size="20"></td>
</tr>
<tr>
<td width="50%">Post Code: </td>
<td width="50%"><input type="text" name="postCode" size="20"></td>
</tr>
<tr>
<td width="50%">When are you looking to have the work carried out?</td>
<td width="50%"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Within the next month</td>
<td><input type="radio" value="nextMonth" checked name="radio1"></td>
</tr>
<tr>
<td>Within the next 6 months</td>
<td><input type="radio" name="radio1" value="6Months"></td>
</tr>
<tr>
<td>Within the next year</td>
<td> <input type="radio" name="radio1" value="NextYear"></td>
</tr>
</table>
</tr>
<tr>
<td width="50%">Brief description of the work required: </td>
<td width="50%"><textarea rows="4" name="description" cols="20"></textarea></td>
</tr>
<tr>
<td width="50%">Optional Description or Comments: </td>
<td width="50%"><textarea rows="4" name="optional" cols="20"></textarea></td>
</tr>
</table>
</form>
</body>

</html>

GreenV8S

31,023 posts

314 months

Friday 15th July 2005
quotequote all
I suspect you could do this all client-side just using a form with a mailto: action (you can put the destination address, subject line and body in the url). Cheap and cheerful, not very flash, but it's a nice low-tech solution.

tvrgit

8,489 posts

282 months

Friday 15th July 2005
quotequote all
You can do it without PHP etc as a simple email form, like GreenV8S suggests.

Here's one that can be pasted into a web page - you'll need to fiddle with it but you get the jist I hope:

<TABLE cellSpacing=0 cellPadding=10 border=0 bgColor=#ffffff width=650>
<TBODY>
<TR>
<TD vAlign=top height=400 colSpan=3 cellpadding=2 cellspacing=2 border=1 bgColor=#dddddd>

<font color="#000000" size="1">
<H3>Thank you for your interest:</H3>
<FORM METHOD="POST" ACTION="mailto:someone@somewhere.com">

<B>Please enter your name:  
</B><INPUT NAME="username" size="30"> <BR>

<B>And your company name:
</B><INPUT NAME="Company" size="30"> <BR>

<B>Address:<br>
</B><TEXTAREA NAME="address" ROWS=6 COLS=60></TEXTAREA>
<br>

<B>Your e-mail address:
</B><INPUT Name="usermail" size="30">
<p>

<B>Telephone:
              
</B><INPUT NAME="tel" size="30"> <BR>

<B>Fax:
              
          
</B><INPUT Name="fax" size="30">
<p>

<B>Which of our services are you interested in?</B>
<br>

    <INPUT TYPE="checkbox" NAME=Civil VALUE="Civil">Civil Engineering<br>
    <INPUT TYPE="checkbox" NAME=Structural VALUE="Structural">Structural Engineering<br>
    <INPUT TYPE="checkbox" NAME=Traffic VALUE="Traffic">Traffic / Transportation<br>
    <INPUT TYPE="checkbox" NAME=General VALUE="General">General Enquiry<br>


Make any comments you'd like below:
<CENTER>
<TEXTAREA NAME="comment" ROWS=6 COLS=60></TEXTAREA>
<P>
<B>Thanks for your input</B>
<BR>

<INPUT TYPE=submit VALUE="Send to DBA">
<INPUT TYPE=reset VALUE="Start over">
</CENTER>
</FORM>
</fonT

</td>
</tr>
<tr bgcolor=#ffffff>
<td>
<IMG width="100" height="50" src="acelogo.jpg">           
<!--img width="227" height="44" src="constructionline.jpg">           -->
<img width="53" height="30" src="iso9001.jpg">
<!--begin text_4--><!--end text_4-->
</FONT>
</TD>
</TR></TBODY></TABLE>

Master Yoghurt

Original Poster:

3,636 posts

283 months

Saturday 16th July 2005
quotequote all
Thanks chaps for your advise and input. Much apreciated

TVRGIT

I tried your form and all I got back was an ATT file which I could not open.

Thanks anyway

Dave

GreenV8S

31,023 posts

314 months

Saturday 16th July 2005
quotequote all
It will probably depend on your browser and email client settings, but when I use that form it opens my email client with some gobbledy gook made up from the form fields. Not pretty, but it works for me.

Since you're sending the mail using the user's email client, you don't need them to enter an email address.

You can set the message subject within the URL eg mailto:me@somewhere.com?subject=quotation request.

With a little more work and a bit of JScript you could make the message body human readable instead of a bunch of URL encoded field values, by constructing the message body from the form fields and appending this content to the mail URL i.e. &body=...

simpo two

92,863 posts

295 months

Sunday 17th July 2005
quotequote all
Good luck Dave - 'forms' was my Omaha Beach: basically where my webskills ground to a halt and bave remained.

'Ah, it's back office functions', they say...