Hi,
Im am using a form to collect data, which is then sent to a specified email address.
Simple enough, but i need the checkbox to give two diferent results.
First see my code:
- HTML: Select all
<form method="post" action="get_a_quote_submission.php">
<table>
<tr>
<td colspan="2">
<div class="header_1">
Get a quote</div>
<br /></td>
</tr>
<tr>
<td>
Name</td>
<td>
<input name="name" type="text" class="form" size="20" /></td>
</tr>
<tr>
<td>
Company</td>
<td>
<input name="company" type="text" class="form" size="20" /></td>
</tr>
<tr>
<td>
Phone</td>
<td>
<input name="phone" type="text" class="form" size="20" /></td>
</tr>
<tr>
<td>
Email</td>
<td>
<input name="email" type="text" class="form"size="20" /></td>
</tr>
<tr>
<td>
URL</td>
<td>
<input name="url" type="text" class="form" size="20" /></td>
<td>
<img src="qm.jpg" alt="This is your website address, e.g. http://www.yourwebsite.co.uk" title="This is your website address, e.g. http://www.yourwebsite.co.uk" style="margin : 0"></td>
</tr>
<tr>
<td>
Service</td>
<td>
<select name="service" class="form" size="1">
<option value="Did not specify"> - - Please select - - </option>
<option value="Web design">Web design</option>
<option value="Logo design">Logo design</option>
<option value="Training">Training</option>
<option value="IT solutions">IT solutions</option>
<option value="Other">Other</option>
</select></td>
</tr>
<tr>
<td>
Message</td>
<td>
<textarea name="message" class="form" cols="20" rows="6"></textarea></td>
</tr>
<tr>
<td colspan="2">
Receive newsletter <input type="checkbox" name="newsletter" value="newsletter" />
</td>
<td>
<img src="qm.jpg" alt="We may occasionally send you a newsletter to the specified email address" title="We may occasionally send you a newsletter to the specified email address" style="margin : 0"></td>
</tr>
<tr>
<td></td>
<td>
<br /><br /><br />
<input type="submit" value=" Submit " class="form"> <input type="reset" value=" Reset " class="form"></td>
</tr>
</table>
</form>
- PHP: Select all
<?php
ini_set("sendmail_from", "info@its-design.co.uk") ;
$name = $_REQUEST['name'] ;
$company = $_REQUEST['company'] ;
$phone = $_REQUEST['phone'] ;
$email = $_REQUEST['email'] ;
$url = $_REQUEST['url'] ;
$service = $_REQUEST['service'] ;
$message = $_REQUEST['message'] ;
$newsletter = $_REQUEST['newsletter'] ;
mail( "info@its-design.co.uk",
"Get a quote submission",
"$name has requested a quote from ITS - Design
\n
The company is - $company
\n
The phone number is - $phone
\n
The email address is - $email
\n
The URL is - $url
\n
The service they require is - $service
\n
The message reads - $message
\n
They $newsletter to subscribe to the newsletter",
"From: $email");
header( "Location: http://www.its-design.co.uk/thank_you_quote.htm" ) ;
?>
Basically i want "$newsletter" to display "want" if the checkbox is checked and "dont want" if the checkbox is unchecked.
Thanks in advance.