Hey,
I have 2 buttons on my page. When I hit the first button my session gets the value '1' and refreshes the page, when I hit the second button my session gets the value '2' and refreshes the page. How can I make this work? I thought of something like this but it doesn't work.
<input type="button" value="1" name="toevoegen" onClick="1();">
<input type="button" value="2" name="toevoegen" onClick="2();">
<script language="JavaScript">
function 1()
{
<? $_SESSION['action'] = 1; ?>
location.reload()
}
function 2()
{
<? $_SESSION['action'] = 2; ?>
location.reload()
}
</script>
One way or the other the session gets always the value 2.
Can someone help me please? The One And Only KryptoS
I have 2 buttons on my page. When I hit the first button my session gets the value '1' and refreshes the page, when I hit the second button my session gets the value '2' and refreshes the page. How can I make this work? I thought of something like this but it doesn't work.
<input type="button" value="1" name="toevoegen" onClick="1();">
<input type="button" value="2" name="toevoegen" onClick="2();">
<script language="JavaScript">
function 1()
{
<? $_SESSION['action'] = 1; ?>
location.reload()
}
function 2()
{
<? $_SESSION['action'] = 2; ?>
location.reload()
}
</script>
One way or the other the session gets always the value 2.
Can someone help me please? The One And Only KryptoS