Consider a domain
"a.com" & "b.com"
from "a.com" i place a link of "b.com" which opens in a new window, now when "b.com" opens there should be a php session start , and during that session when user refresh the page of "b.com" the page should be redirected to "b.com/sample" (i-e i don't want the direct access to "b.com" , i want the access to "b.com" only when it is referred from "a.com")
Can anyone help ?
I am very new to php , so please don't make fun of my Question
Help me building a simple php code !!
Moderator: General Moderators
-
seekndestroy88
- Forum Newbie
- Posts: 2
- Joined: Sun Sep 27, 2009 3:07 pm
Re: Help me building a simple php code !!
use $_SERVER['HTTP_REFERER'] on site b:
Code: Select all
<?php
if ($_SERVER['HTTP_REFERER'] == "sitea"){
// actions to be executed when users access site b from site a
}
?>-
seekndestroy88
- Forum Newbie
- Posts: 2
- Joined: Sun Sep 27, 2009 3:07 pm
Re: Help me building a simple php code !!
Thankyou , and what will be the code for the condition
if site b is not referred by site a then the url should be redirected to siteb/sample.htm
if site b is not referred by site a then the url should be redirected to siteb/sample.htm
Re: Help me building a simple php code !!
This can be easily spoofed btw.