Thank you for the input, very much appriciated!
I updated the script and I'm halfway to succeed with the funcktionlity but there is something that not is working as it should...
When opening the http://www.g8journey.com/destination...tions_main.php page the script automatically selects photos with attirbute Sun & Beach without me clicking the checkbox. Why is that?
The checkbox is unchecked so the script should show all photos.
Client-side script:
Code:
if(GBrowserIsCompatible()) {
map = new GMap2(document.getElementById('map'));
map.setCenter(new GLatLng(30.178868, 116.38), 1);
map.addControl(new GLargeMapControl());
var icon = new GIcon(G_DEFAULT_ICON);
var sunbeachValue;
sunbeachValue = document.getElementById("sunbeach").checked;
if(document.getElementById("sunbeach").checked)
{//checked
sunbeachValue = true;
}
else
{ //not checked
sunbeachValue = false;
}
icon.image = "http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png";
GDownloadUrl("phpsqlajax_genxml2.php?sunbeach=" + sunbeachValue +"&bogus="+(new Date()).getTime(),processMyData); //Calls the xml-data and sends it to processMYyData-function
}
}
And the form:
Code:
echo '<form id="showtype" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">
<input type="checkbox" style="cursor:hand" name="sunbeach" id="sunbeach" value="sunbeach"/>
<label for="var">Sun & Beach</label><br />
<input class="submit" type="submit" name="showtype" value="Show Type" />
</form>';
Serverside script:
Code:
$sunbeachstatus = $_REQUEST['sunbeach'];
IF ($sunbeachstatus == true){
$query = "SELECT * FROM plogger_pictures WHERE type_of_exp='1'";
}
ELSE
{
$query = "SELECT * FROM plogger_pictures";
}
All help is so appriciated!
Thank you,
/Nimrod
Bookmarks