Code: Zaznacz cały
<?
if ($_POST['wyslany'] == "tak")
{
if ( !empty($_POST['trade']) && !empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['last']) && !empty($_POST['phone']) )
{
$message = "<b>Trade:</b>\n$_POST[trade]\n\n<br><br>
<b>Specialism</b>: $_POST[specialism]\n\n<br><br>
<b>Brief job summary:</b> $_POST[brief]\n\n<br><br>
<b>Detailed description:</b> $_POST[description]\n\n<br><br>
<b>Job address:</b> $_POST[address]\n\n<br><br>
<b>Job postcode:</b> $_POST[postcode]\n\n<br><br>
<b>Approx budget:</b> $_POST[budget]\n\n<br><br>
<b>No. of quotes:</b> $_POST[quotes]\n\n<br><br>
<b>Job to start:</b> $_POST[start]\n\n<br><br>
<b>Name:</b> $_POST[name]\n\n $_POST[last]\n\n<br><br>
<b>E-mail address:</b> $_POST[email]\n\n<br><br>
<b>Phone number:</b> $_POST[phone]\n\n<br><br>
";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "From: $_POST[imie] <$_POST[email]>\r\nContent-type: text/html; charset=utf-8\r\n";
mail("marcinmadro@gmail.com","Formularz kontaktowy compcontrol","$message","$headers")
or die('Your message has not been sent');
echo "<div align=\"center\"><strong>Your message has been sent</strong></div>";
$wiadomosc_wyslana = "poprawnie";
}
else echo "<font face=\"Arial\" color=\"#FF0000\" size=\"1\">Please fill all the fields marked with a star!</p>";
}
if ($wiadomosc_wyslana != "poprawnie")
{
?>
<div style="width:850px; height:50px; margin:10px 50px 15px 23px; background:url(images/home_008.png) no-repeat; border:none">
</div>
<div style=" margin-left:150px;">
<table border="0"><form method="post">
<tr>
<td align="right"> * Trade:</td>
<td><select name="trade" style="width: 355px ">
<option>Please select a trade</option>
<option>Broadband repairs</option>
<option>Computer design and build</option>
<option>Data recovery</option>
<option>Data transfer</option>
<option>Diagnostic reports</option>
<option>Driver installations</option>
<option>Laptop repairs</option>
<option>Network / Broadband installations</option>
<option>PC boot up</option>
<option>PC health check / Computer service</option>
<option>PC setup</option>
<option>Personal tuition</option>
<option>Satellite dish installations</option>
<option>System restore</option>
<option>System upgrades</option>
<option>Telephone wiring and problem solving</option>
<option>TV aerial installations and upgrades</option>
</select></td>
</tr>
<tr>
<td align="right"> Specializm: </td>
<td> <input type="text" id="specializm" style="width:355px; height:25px; background:url(images/form_01.png) no-repeat; border:none;" /></td>
</tr>
<tr>
<td align="right"> Brief job summary: </td>
<td> <input type="text" id="brief" style="width:355px; height:25px; background:url(images/form_01.png) no-repeat; border:none;" /></td>
</tr>
<tr>
<td align="right" valign="top">Detailed description:</td>
<td ><textarea name="description" style="width: 355px; height: 87px; background:url(images/form_02.png) no-repeat; border:none"></textarea></td>
</tr>
<tr>
<td align="right" valign="top">Job Address:</td>
<td ><textarea name="address" style="width: 355px; height: 87px; background:url(images/form_02.png) no-repeat; border:none"></textarea></td>
</tr>
<tr>
<td align="right">Job postcode:</td>
<td ><input type="text" name="postcode" style="width:355px; height:25px; background:url(images/form_01.png) no-repeat; border:none;" ></td>
</tr>
<tr>
<td align="right">Approx budget:</td>
<td ><input type="text" name="Approx budget" style="width:355px; height:25px; background:url(images/form_01.png) no-repeat; border:none;x" ></td>
</tr>
<tr>
<td align="right">
No. of quotes:
</td>
<td><select name="quotes" style="width: 50px">
<option>1</option>
<option>2</option>
<option>3</option>
</select></td>
</tr>
<tr>
<td align="right">Job to Start:</td>
<td><select name="start" style="width: 250px">
<option>Please select a start date</option>
<option>ASAP</option>
<option>within 2 weeks</option>
<option>within 1 month</option>
<option>1-2 months</option>
<option>2-4 months</option>
<option>flexible</option>
</select></td>
</tr>
<tr>
<td align="right"> * First name: </td>
<td> <input type="text" id="first_name" style="width:355px; height:25px; background:url(images/form_01.png) no-repeat; border:none;" /></td>
</tr>
<tr>
<td align="right"> * Last name: </td>
<td> <input type="text" id="last_name" style="width:355px; height:25px; background:url(images/form_01.png) no-repeat; border:none;" /></td>
</tr>
<tr>
<td align="right"> * E-mail address: </td>
<td> <input type="text" id="email" style="width:355px; height:25px; background:url(images/form_01.png) no-repeat; border:none;" />
</td>
</tr>
<tr>
<td align="right"> * Mobile phone: </td>
<td> <input type="text" id="mobile" style="width:355px; height:25px; background:url(images/form_01.png) no-repeat; border:none;" />
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="Send"> <input type="reset" name="reset" value="Reset"></td>
<input type="hidden" name="wyslany" value="tak">
</form>
</tr>
</table>
</div>
<div id="texts" align="center">
<br />
<div style=" width:600px; height:150px; background:url(images/home_006.png) no-repeat;"> <br />
<p>Post your job and get great quotes </p>
<table>
<tr valign="top">
<td>email:</td>
<td>
<a href="mailto:ask@compcontrol.co.uk">ask@compcontrol.co.uk</a>
</td>
</tr>
<tr>
<td>office:</td>
<td style="font-size:17px; font-weight:bold; color:#f95403;">02085673076</td>
</tr>
<tr>
<td>mobile:</td>
<td style="font-size:17px; font-weight:bold; color:#f95403;">07786516366</td>
</tr>
</table>
</div>
</div>
<?php
}