i am using javascript confirm box with a submit button that calls a javascript function as shown.Inside the funcion,i am setting a PHP Session variable(i don't know whether its possible to do so).i.e.
<input type="submit" name="delete" value="Delete Album" onclick="**cdelete()**">
The javscript function is:
<script type="text/javascript">
function cdelete(){
var f=confirm("Are you sure you want to delete this Album?");
if(f==true)
{
<?php $_SESSION['temp']=25;?>
}
else if(f == false)
{
<?php $_SESSION['temp']=45;?>
}
}
</script>
But the problem is that the session variable always takes the value 45.i.e the value when f==false even if i press ok button i.e. even if the confirm box returns f as true.
Any help??