How to pass variables from one php page to another without form?

前端 未结 6 2378
滥情空心
滥情空心 2020-12-13 07:37

I want to know how to pass a variable from one page to another in PHP without any form.

What I want to achieve is this:

  1. The user clicks on a link
6条回答
  •  死守一世寂寞
    2020-12-13 07:47

    You can pass via GET. So if you want to pass the value foobar from PageA.php to PageB.php, call it as PageB.php?value=foobar.

    In PageB.php, you can access it this way:

    $value = $_GET['value'];
    

提交回复
热议问题