Welcome to WebmasterWorld Guest from 54.196.231.129

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Allowing 'registered' members to view different content then 'non reg'

Registered users seeing different content

     
7:39 am on Feb 8, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 3, 2011
posts: 58
votes: 0


I know how to set it so the download link is not visible for 10 seconds (timed countdown) How would I go about setting it so viewers who are not logged in (or not registered users) see the 10 second countdown before being able to click the link, however if they are a registered member and have logged in, they see the link with out the countdown delay.
5:53 am on Feb 10, 2011 (gmt 0)

Full Member

10+ Year Member

joined:July 6, 2005
posts:215
votes: 0




session_start();

if(!isset($_SESSION['user'])){
echo "<script>start_count_down();</script>";
} else {
echo "<a href='link'>download my thing</a>";
}


This code assumes you have a time Javascript, that should go in the script tag. it also assumes you have some code settings the user session. (e.g. a login script)

If you know what their IP's are you could do it using

$ips = array('1.1.1.1','2.2.2.2','3.3.3.3');
if(!in_array($_SERVER['REMOTE_ADDR'], $ips)){


Good luck :-)