PHP Pass Data with Redirect

前端 未结 3 1304
北恋
北恋 2020-12-06 12:53

PHP Redirect with Post Data

Hi,

I am a newbie PHP programmer and trying to code a small blog.

I will explain what I am trying to do.

  • pa
3条回答
  •  再見小時候
    2020-12-06 13:25

    You could also just append a variable to the header location and then call it from the page.

    header('Location: http://example.com?message=Success');
    

    Then wherever you want the message to appear, just do:

    if (isset($_GET['message'])) {    
       echo $_GET['message'];
    }
    

提交回复
热议问题