Hey everyone, something really weird has been bugging me. Tried to find the problem i just can’t think of anything that could be wrong with it…
here is the code maybe someone on here might be able to help.
[php]if(isset($_POST[‘battles’]))
{
$_SESSION[‘npcid’] = $npcid;
}
echo"<form method='post' action='fight.php'>
<input type='submit' name='battles' value='fight' >
</form>";[/php]
So if i remove the if(isset($_POST[‘battles’])) which activates when the button is clicked the session works fine but when i add it nothing works, I tried many different ways that could help me for example replacing it with if($_SERVER[‘REQUEST_METHOD’] == “POST”) but no luck, nothing.
I did add session start because like I said it doesn’t work only when i add that button click…
If anyone has any ideas to what’s wrong with this small code please help me because i really am lost.
Thank you.