I AM WEAK IN JAVASCRIPTING, PLEASE HELP ME.THIS IS MY BASIC IDEA TO TOGGLE VALUES USING JAVASCRIPT
<?php $xyz=5; ?>
<head>
<script type="text/javascript">
var x;
function displaymessage()
{
if (x==5)
{
alert("yes");
x=1;
}
else
{
alert("no");
x=5;
}
}
</script>
</head>
<body>
<form>
<input type="button" value="Click me!" onclick="displaymessage();" />
</form>
<p>By pressing the button above, a message WILL APPEAR.</p>
</body>
NOW I WANT TO USE THE SAME LOGIC SO THAT I CAN TOGGLE PHP VARIABLE ON CLICKING THE BUTTON.ON CLICKING FIRST TIME, THE PHP VARIABLE SHOULD RETURN 0, ON CLICKING SECOND TIME, IT SHOULD BE VALUE OF $xyz. and so on...