在同一页面POST提交表单并防止刷新

';

    print_r($_POST);
    echo 'Please try again';

    echo '
'; } else { ?>
Name:
Email:
Beer:

 

 

 

';   
         
              print_r($_POST);   
              print 'Please try again';   
         
              print '
'; $_SESSION['num']=500; } else { print '
';   
         
              print_r($_POST);   
              echo "However you have submitted";   
              print '
'; } } else { session_start() or die("session is not started"); $_SESSION['num']= 400; ?>
Name:
Email:
Beer:

 

你可能感兴趣的:(PHP)