How do I save the original $_SERVER['HTTP_REFERER']; on a page that refreshes several times?

前端 未结 4 762
一个人的身影
一个人的身影 2021-01-21 22:58

I have a page where I need to get the referring URL so I can redirect them back after they compete a form. My problem is, the form has several drop menus and each time a selecti

4条回答
  •  半阙折子戏
    2021-01-21 23:41

    Store the referer in the first request into a session variable or a cookie. $_SESSION or $_COOKIE super globals can help achieve this.

    I recommend sessions as the user won't be able to hijack the value locally.

提交回复
热议问题