OK I have made a start on this from the bottom up.
Basically I need to create a load of checkboxes to allow the user to improve the results they see from the original output.
What I mean by this, is that they forst select the country then they go to a results page, where on the left they will have a choice of dynamically generated regions for that country, star ratings which could be set really, and possibly ammenities which will also be dynamically generated.
Then on select of any checkbox the page refershes and the results change according to that selection, and so on as much as they wont.
So ive started with below, and would like an opinion. Again I’m not a high end programmer, but learning quickly, so I have got my limits and prefer to build up rather than jump in head first.
<?
session_start();
include("config.php");
?>
<?
$url = $_SERVER['REQUEST_URI'];
print "<pre>";
print $url;
$url_parsed = parse_url($url);
print_r($url_parsed);
parse_str($url_parsed['query'], $url_parts);
print_r($url_parts);
print "</pre>";
?>
<head>
<script language="JavaScript">
function checkRefresh(value)
{
document.form1.submit();
}
</script>
</head>
<body>
<div id="wrapper">
<form name="form1">
<input type="checkbox" name="checkOne" value="1" onClick="javascript:checkRefresh()" checked="checked"> 1
<!--<input type="checkbox" name="checkOne" value="1" onClick="javascript:checkRefresh()" <? if ($checkOne > "") { ?> checked="checked" <? } else { ?> <?} ?>> 1 -->
<input type="checkbox" name="checkTwo" value="2" onClick="javascript:checkRefresh()"> 2
<input type="checkbox" name="checkThree" value="3" onClick="javascript:checkRefresh()"> 3
<input type="checkbox" name="checkFour" value="4" onClick="javascript:checkRefresh()"> 4
</form>
<div id='result_table'></div>
</div>
</body>
</html>
What im trying to do above is create the url strings, which seems to be working fine, as you can see in the link below.
http://devchecksafetyfirst.csf.dcmanaged.com/
If this is fine, the next thing im trying to do is at first have the checkboxes unchecked, but if after reading the url its value is > “” then the checkbox is kept checked, as the user then continues to selct other checkboxes to refine their results.
Sorry for this edit, but on thinking of it should change the checkbox names to below isnt it.
<input type="checkbox" name="check[]" value="1" onClick="javascript:checkRefresh()" checked="checked" />1
<input type="checkbox" name="check[]" value="2" onClick="javascript:checkRefresh()"> 2
<input type="checkbox" name="check[]" value="3" onClick="javascript:checkRefresh()"> 3
<input type="checkbox" name="check[]" value="4" onClick="javascript:checkRefresh()"> 4
But still got the problem of checking if one of them has a value to either keep it checked or not.