Code: Select all
<script language="javascript" type="text/javascript">
function Citychange()
{
var city = document.getElementById('cityId').value;
window.location.href="http://www.example.com/Live/indexcity.php?City=" + city;
}
</script>
<select name="city" id="cityId" class="city_texbox" onchange="javascript:Citychange(this.value)">
<option value="" selected="selected">Mumbai</option>
<option value="" selected="selected">New York</option>
<option value="" selected="selected">London</option>
</select>
which works fine.
But in indexcity.php displays blank page.
indexcity.php code is following.
Code: Select all
$city=$_GET['City'];
if(isset($_GET ['City']))
{
if(!isset($_COOKIE['City']))
{
setcookie ("City", $_GET['City'],time()+3600,"/Live");
}
}
if (isset($_COOKIE['City'])) {
echo $_COOKIE['City'] ;
}
Please help me.
Thanks in advance.