刷新页面后内容消失(Wordpress)

I am developing a plugin where i have a form and a submit button. The form-action is the_permalink(). When the user clicks on the submit-button, a message ("hello") should be visible, which works fine with this code:

if(isset($_POST['submit']))
{
   display();
}
function display()
{
    echo "hello";
}

But if i refresh the page, the message is gone. Does anybody know how to fix this to that the message stays there?

This has porbably something to do with that i compare $_POST with 'submit', which is not given after a refresh...

Thanks for your help!

Please try following code

   session_start();
if(isset($_POST['submit']))
{
   $display_val = display();
   $_SESSION['display_val'] = $display_val;
}

if(isset($_SESSION['display_val']))
{
    echo $_SESSION['display_val'];
}


function display()
{
    return "hello";
}