I have created a form (below)
How do I stop it redirecting to another page (productsearchresults.php) when
form is submitted if both the fields are blank?
Any help appreciated.
Batezz
<?php
$redirect = "/Product/Productsearchresults.php";
if( empty($CityTown) && empty($County)) {$redirect="";}
?>
<body>
<form action="../Product/$redirect" method="post" name="location search"
id="location search">
<p>Location search</p>
<p>
<label>City/Town
<input name="CityTown" type="text" id="CityTown" />
</label>
</p>
<p>
<label>County
<input name="County" type="text" id="County" />
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="Search" />
</label>
<label> </label>
</p>
</form>
</body>