I have created an login system with form which use POST method. This POST send information to the login.php which included into the index php. In the login.php if the username and password correct a few jQuery code change some things (add menu items) on the index.php. My problem is that when I want to refresh the page the Firefox always send a confirm message (To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.). I have red about it and I know that this problem is about I use POST method to send data. Some people suggested to use GET method, although the message do not appear but the data don't send as well. Could you suggest a solution (if it is exist)? Thank you in advance for your help.
My php code:
$query1 = pg_query($conn, "SELECT * from users WHERE password = '$pswd' and name='$username' ");
$arr_1 = pg_fetch_all($query1);
$name_lenght= strlen($arr_1[0][name]);
$pswd_lenght= strlen($arr_1[0][password]);
if ($name_lenght > 0 && $pswd_lenght > 0){
$_SESSION ['user'] = $_POST['user'];
$_SESSION ['password'] = $_POST['password'];
echo "<script>
$('#manu1').removeClass('hide').addClass('show');
$('#manu2').removeClass('hide').addClass('show');
$('#manu3').removeClass('hide').addClass('show');
</script>";