Here's an example. I've used "x" instead of radioPressed for the variable.
Code:
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Title</title>
<meta name="language" content="en" />
<script type="text/javascript">
//<![CDATA[
function passVariable(){
// set your variable
var x = '123';
// get the current url and append your variable
var url = document.location.href + '?x=' + x;
// to prevent looping, check to make sure your current url contains a common string
var exists = document.location.href.indexOf('?x=');
if(exists < 0){
// redirect passing your variable in
window.location = url;
}
}
//]]>
</script>
</head>
<body onload="passVariable()">
<?php echo $_REQUEST['x']; ?>
</body>
</html>
Bookmarks