Any php coders around?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • goldfish
    Confirmed User
    • Jan 2009
    • 723

    #1

    Any php coders around?

    Here's what I want to do.

    First click to video, every subsequent click after that goes to join form.

    Would a simple session script work?

    start_session();

    session_register("clicks")

    if ($clicks > 1){

    header ("Location: join form");
    }
    any downfalls of doing it this way?

    any way someone could get around it?
    ICQ: 566990329

    "There is no rest for the wicked... and porn purveyors!
  • GrouchyAdmin
    Now choke yourself!
    • Apr 2006
    • 12085

    #2
    You can fill up your session dir and/or have issues with cookies. Remember to destroy your session somewhere, too, and setup a cleanup crontab.

    That's ugly, but it'll likely do what you want.

    Code:
    @start_session();
    $_SESSION['clicks'] = (isset($_SESSION['clicks'])) ? (int)$_SESSION['clicks']+1 : 1;
    if ($_SESSION['clicks'] > 1){
      header ("location: join form");
    }
    Last edited by GrouchyAdmin; 12-22-2009, 09:07 PM.

    Comment

    • cyco_cc
      Confirmed User
      • Oct 2008
      • 344

      #3
      I second what Grouchy says. You could destroy the session on the join page because at that point, presumably, you don't care about the session value.

      Comment

      • goldfish
        Confirmed User
        • Jan 2009
        • 723

        #4
        Originally posted by GrouchyAdmin
        You can fill up your session dir and/or have issues with cookies. Remember to destroy your session somewhere, too, and setup a cleanup crontab.

        That's ugly, but it'll likely do what you want.

        Code:
        @start_session();
        $_SESSION['clicks'] = (isset($_SESSION['clicks'])) ? (int)$_SESSION['clicks']+1 : 1;
        if ($_SESSION['clicks'] > 1){
          header ("location: join form");
        }
        and thats where the problem lies, if I destroy the session they can get to more content, right?

        I could put the seesion destroy inside the members area but that still leaves a bunch open
        Last edited by goldfish; 12-22-2009, 09:19 PM.
        ICQ: 566990329

        "There is no rest for the wicked... and porn purveyors!

        Comment

        • cyco_cc
          Confirmed User
          • Oct 2008
          • 344

          #5
          Yes, of course they can. So, log the IP of the user and the date of the access. Make that check on page load, if they've accessed content in the last 24 hours (or whatever) redirect them to the join page.

          Note, at that point, the SQL query can do cleanup on the log or you can set up cron job to do it.

          Comment

          • goldfish
            Confirmed User
            • Jan 2009
            • 723

            #6
            Originally posted by cyco_cc
            Yes, of course they can. So, log the IP of the user and the date of the access. Make that check on page load, if they've accessed content in the last 24 hours (or whatever) redirect them to the join page.

            Note, at that point, the SQL query can do cleanup on the log or you can set up cron job to do it.
            that might actually work, I am already logging their ip for something else
            ICQ: 566990329

            "There is no rest for the wicked... and porn purveyors!

            Comment

            • Killswitch - BANNED FOR LIFE

              #7
              Just put a new field in the database for the ip logging to reflect the views, and that way no matter what, that user comes back they will get sent to the join form.

              Comment

              Working...