Hello.
No worries I think where im getting confused is the site has site_search_advanced.html (template) and site_search_advanced.php
If I enter your script in search_search_advanced.php it says empty postcode because the var is not set, is that right?
The template file contains, amongst other search features:
<td><strong>Zip / Postal Code</strong> <font class="normal_12_red"></font></td>
<td><strong>:</strong></td>
<td>
<input type="text" name="szip" value="{$szip}" class="textbox" style="width:100px" />
</td>
</tr>
{if $zip_radius_enable == "yes"}
<tr>
<td><strong>Radius</strong> <font class="normal_12_red"></font></td>
<td><strong>:</strong></td>
<td>
<select name="sradius" class="textbox" style="width:105px">
<option value="">Any radius</option>
{section name=var loop=$radius_id}
<option value="{$radius_id[var]}" {if $radius_status[var] == "yes"} selected {/if} >{$radius_name[var]}</option>
{/section}
</select>
</td>
</tr>
{/if}
Would this be where I needed to set the variable? This script is for a job seekers website so the user search for a job within a radius of a postcode. The postcode the user enters will be full length (CT11 0TT), the job will contain a full length postcode (ME2 7NN) but the radius database only contains the area code.
How can I implement your script to cut down both the job seekers postcode and the jobs listed postcodes within the radius?
Does the following script contains all 3 references to postcodes, search postcode, job postcode and radius area code?
[code=php]$i = 0;
$sql_query = "SELECT * FROM setup_radius ORDER BY radius_order ASC, radius_name ASC";
$result = mysql_query($sql_query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$radius_id = $row[radius_id];
$radius_name = $row[radius_name];
$arr_radius_id[$i] = $radius_id;
$arr_radius_name[$i] = $radius_name;
$arr_radius_status[$i] = "no";
if ($radius_id == $sradius) { $arr_radius_status[$i] = "yes"; }
$i++;
[/code]
Sorry if I sound a little slow on this and I do really appreciate your help and I cant wait to see this working