Hello,

I'm new to this forum and somewhat to Php (i'm self-learning from books).

What I would like to do (but don't know how) is to create a 100% web-based version of a sequential autoresponder (*that is, instead of emailed sequential messages, clients can log into a password protected site and view the pre-programmed messages on my website).

I offer an informational product which after people purchase, they receive 3 simple emails spaced 1 day apart: (sort of like an mini-ecourse). Problem is, no one is getting it because the auto emails go straight to spam/bulk mail folders, customers, empties these folders automatically, and then email me asking where there information is!

So here is a rough idea of how I would like to do it, and would like comments/suggestions or even php scripts already available that do the following:

(1) Customer buys information product which is behind a "Members Only" password/username protected page. (Plenty of membership scripts so this is not a problem).

(2) Customer logs into "members only" area, and sees' the following pages, shown sequentially, from the date they purchased:

Day 1: Information A (accessible immediately after purchase/login)
Day 2: Information B (only accessible after 24 hours have passed from Day 1)
Day 3: Information C (only accessible after 48 hours after they purchased).

All of the information is accessible through my web site, coded in php, and no emails are sent. (Hope this makes sense).

Now the question of the hour: How do I program this in php?

Again, its' imitating a regular email autoresponder, but the display is 100% in a web-browser.

Thanks in advance!
Kaity
(sorry for long post, I just hope it makes "sense")

    I take it you are using a set of database tables for this site? Maybe a users table and an orders/purchase table ? If so you should have the date/time that an order was placed stored somewhere in the database correct?

    So you should be able to find out the time since the order was placed - and show the required information accordingly.

    Check out this script (http://www.gidnetwork.com/b-16.html) for a good time difference function.

    // this is only pseudocode - you'll have to fill in your own bits
    
    $time_today = date();
    $time_purchased = //get this from the database
    
    $time_difference = time_difference_function($time_purchased, $time_today);
    $time_diff_hours = $time_difference['hours'];
    
    if($time_diff_hours < 24) // Within the first day
    {
    // Information A (accessible immediately after purchase/login)
    }
    if($time_diff_hours > 24 && $time_diff_hours < 48) // Second Day
    {
    // Information B (only accessible after 24 hours have passed from Day 1)
    }
    if($time_diff_hours > 48) // Third day
    {
    // Information C (only accessible after 48 hours after they purchased).
    }
    

      Thanks Khendar!

      I will try your suggestion, but just before I came here to see your reply, I found this code at the developers' site: Developertutorials.com

      Creating a Php Timer

      This timer is the simplest and easiest to implement. It will determine the time taken for a php script to execute correct to 0.000000000000001 seconds.

      <!-- put this at the top of the page --> 
      <?php 
            $mtime = microtime(); 
            $mtime = explode(' ', $mtime); 
            $mtime = $mtime[1] + $mtime[0]; 
            $starttime = $mtime; 
      ?> 
      
      <!-- put other code and html in here --> 
      
      
      <!-- put this code at the bottom of the page --> 
      <?php 
            $mtime = microtime(); 
            $mtime = explode(" ", $mtime); 
            $mtime = $mtime[1] + $mtime[0]; 
            $endtime = $mtime; 
            $totaltime = ($endtime - $starttime); 
            echo 'This page was created in ' .$totaltime. ' seconds.'; 
      ?>

      So, how would I tell it to run script in 1 day increments (24 hours)?

      Kaity

        That script is not quite what you want. Thats designed for measuring the time it take a script to run through a single execution (eg to load a page or query a database). It wont really do what you want it to.

          Write a Reply...