I have 5 dropdowns, each one dependent on the previous one (except the first one obviously). These drop downs are named as City, Area, Block, Street, Label.
City drop down's code is as follows
Code: Select all
<form name="theForm" method="get">
<!-- city SELECTION -->
<select name="city" onChange="autoSubmit();">
<option value="null">Select City.....</option>
//the code to fetch data from mysql goes here
//Where autoSubmit() is defined as
<script language="JavaScript">
function autoSubmit()
{
var formObject = document.forms['theForm'];
formObject.submit();
}
</script>
The following code runs fine on my localhost (i am using wampserver 2.0i) or even any other localhost (that means it doesn't seem to have common mistakes like session isn't started etc).
Code: Select all
if($city != null && is_numeric($city) && $area != null && is_numeric($area) && $block != null && is_numeric($block) && $street != null && is_numeric($street) && $label != null && is_numeric($label))
{
$_SESSION['city'] = $city;
$_SESSION['area'] = $area;
$_SESSION['block'] = $block;
$_SESSION['street'] = $street;
$_SESSION['label'] = $label;
require("map.php");
$city = $area = $block = $street = $label = 0; //RESETS THE DROPDOWNS SO THAT AFTER THIS LOOP THERE IS ONLY CITY DROPDOWN VISIBLE WITH DEFAULT NULL VALUE
}
else
{
//some code here
}This code runs smooth on my localhost. After making complete selection till label, it shows the marker on google map. But when i uploaded this on my domain, it doesn't execute require("map.php") properly and just resets the dropdowns(i mean no map or marker is visible).
That means session variable aren't passed to map.php or other file (required in map.php).
I am stuck in it for two days and couldn't find a solution. Any help would be highly appreciated. I Think i have decribed everything properly. If still some questions, feel free to ask.
Regards