Hi,
I have a script which makes links available at certain times depending when a member joined the site
Im new to php and struggling to find simple answers on the web regarding it.
basically I want someone to log into the site, the site to check when they signed up and display links depending on their membership duration.
If someone could help me write this script I would be eternally grateful. I have a script below which I can modify to suit. Its just the begining I am struggling with.
so its like this -
they log in.
the site checks their signup date.
if they have been a member for 1 day then link 1 is displayed,
if they have been a member for 2 days then link1 and link 2 will display etc.
I really am a noob at php. If someone could help me or guide me, I would be very very thankful
In the header.php - What do i put in here regarding finding information about signup date and if they are logged in?
is it -
<?php include('header.php'); ?>
<?php
session_start();
$signupdate
$lesson[0] = "Positioning Your Fingers";
$link[0] = "lesson01_secretkey.php";
$desc[0] = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sagittis ipsum at lorem. Suspendisse feugiat. Sed imperdiet orci at magna.";
$days[0] = 0; // for immediate
$lesson[1] = "Understanding the Rythm";
$desc[1] = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sagittis ipsum at lorem. Suspendisse feugiat. Sed imperdiet orci at magna.";
$link[1] = "lesson01_secretkey.php";
$days[1] = 30; //
<h1>Your Lessons</h1>
<?php
$seconds_a_day = 86400;
for($i = 0; $i < count($lesson); $i++)
{
$days_to_release = $days[$i] * $seconds_a_day;
$release_date = $signupDate + $days_to_release;
$j = $i + 1;
if ($release_date > time())
{
echo "<p style='color: #999;'><strong>Lesson ".$j.": <u>".$lesson[$i]."</u></strong><br/>".$desc[$i]."<br/><em>available to you on ". date('l jS \of F Y', $release_date) ."</em></p>";
}
else
{
echo "<p><strong>Lesson ".$j.": <a href='".$link[$i]."'>".$lesson[$i]."</a></strong><br/>".$desc[$i]."<br/><em>Content released on ". date('l jS \of F Y', $release_date) ."</em></p>";
}
}
?>
<!-- CONTENT GOES HERE -->
<?php include('footer.php'); ?>