开发者

define, that the user came from specific page? (in PHP)

开发者 https://www.devze.com 2023-02-17 18:40 出处:网络
Is there the way in PHP to define, that the user came from specific page? without \"post\" requests. I have a \"add post\" page. when user submit a post, on the next page he can submit some more infor

Is there the way in PHP to define, that the user came from specific page? without "post" requests.

I have a "add post" page. when user submit a post, on the next page he can submit some more information. But when user click "back" in browser he returns to blank "add post" form, and what I nee开发者_如何学Cd is that the user can modify previously submitted info, but only if he presses back from this second page.

$_SERVER['HTTP_REFERER'] - doesn't seem to work.

Maybe I can set some data in $_SESSION on second page and celar it on every other page except the first.. but its seems like not very smart.


PHP $_SESSION is a great, easy fix for storing temporary data (especially if you can't use $_POST). You only need to clear the SESSION value once, not on every page.

I'm not 100% clear on what you're asking, but try looking at some other values in $_SERVER; they may have what you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消