how to create a popup only accessible via my website

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Mijanur
Forum Newbie
Posts: 10
Joined: Wed Aug 02, 2006 8:23 am

how to create a popup only accessible via my website

Post by Mijanur »

Hi

how can i stop other people from using my popup that i have on my website, what can i do so people can only access the popup only through my site??


thanx for you time

Myjaan
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't see the connection to PHP here. This is a client-side issue. Moved.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

This is a php issue because it needs a permission based system using sessions or cookies.
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

With a referal check it can easily be done
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

I would recommend setting a session or cookie variable valid for a specific period of time.

ie (psuedo)

Code: Select all

// you have to be here first..

session_start();
$_SESSION['isAuthorized'] = 'yes';
$_SESSION['authTime'] = // microtime or something

Code: Select all

// now you can look at this..

session_start();
if (!empty($_SESSION['isAuthorized']) && ($_SESSION['isAuthorized'] == 'yes') && ($_SESSION['authTime'] >= ($now - 20000))) {
  // display the page

} else {
  header("Location: http://gobacktowhereyoucamefrom.com");
}
Post Reply