Building a website......A few Qs....Help please
Discussion
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
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
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>
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>
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>
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>
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=...
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=...
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


