简体   繁体   中英

check if webpage comes from another webpage

How would i check if someone is redirected to my site. How do i check what site they came from? PHP is preferable here.

What I'm trying to do is code a TOS, and they have to come from that part of my site. Like if they come from the Terms of Service/Agreement page, and accepted (I know how to check that), then the page will function normally, if not it will pop up the TOS and they'll have to accept it then....

Or should i use a $_SESSION variable?

Thanks in advance guys.

You could try looking into $_SERVER['HTTP_REFERER'] . But yes, using sessions to check if they agreed to your TOS is a better choice (or just client side cookies)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM