age check for pages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    age check for pages

    can some one help me and tell me where i have gone wrong on this please

    Code:
    <?php
    $age = 16; /*Required Age*/$date = getdate();
    $year = $date['year'];
    /*Assuming $_POST['YearOfBirth'] is the year of birth specified by the user*/if ($year – $_POST['YearOfBirth'] >= $age){ /* Redirect to your homepage */header("Location: http://yourdomain.com/index.php"); /*Change http://yourdomain.com/index.php to your home page*//*
    }else{die("you can not access this part"); 
    }
    ?>
    i am trying to get it to work on lava script
    Last edited by brand; 13.04.10, 15:03.
    HELP THEM WHO HELPS YOU



    i only work on wapdesire v_2 coding only

    #2
    didnt find any wrong code but what error you get. tell it so we can say where problem is..
    Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

    Comment


      #3
      i want it so it takes me back to the main page if they are under 18 and if there over 18 it takes them to the page they want to go to

      Code:
       this is also the error i get as well
      
      Parse error: syntax error, unexpected T_STRING in /home/********/public_html/malex/index.php on line 211
      the error is on this line
      Code:
      if ($year – $_POST['YearOfBirth'] >= $age){
      have i done some thing wrong ppl
      Last edited by brand; 13.04.10, 15:40.
      HELP THEM WHO HELPS YOU



      i only work on wapdesire v_2 coding only

      Comment


        #4
        PHP Code:
        agelimit(); 

        PHP Code:
        function getage($birthdate

           list(
        $day$month$year) = split('-',  $birthdate); 
                      
        $tmonth date('n'); 
                      
        $tday date('j'); 
                      
        $tyear date('Y'); 
                      
        $years $tyear $year
                      if (
        $tmonth <= $month
                      { 
                      if (
        $month == $tmonth
                      { 
                      if (
        $day $tday)$years--; 
                       } 
                       else 
        $years--; 
                       } 

                   return 
        $years

        PHP Code:
        function agelimit($text)
        {
        $age mysql_fetch_array(mysql_query("SELECT age FROM YOURBASE WHERE id='".$id." ' "));
        echo 
        mysql_error();
        $isage getage($age[0]);
        if(
        $isage<18)
        {
                echo 
        "<br/>You have to be 18+ to view this place.<br/>";
        }

        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
        Visit: WapMasterz Coming Back Soon!
        _______
        SCRIPTS FOR SALE BY SUBZERO
        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
        _______
        Info & Tips
        php.net
        w3schools.com

        Comment


          #5
          Originally posted by subzero View Post
          PHP Code:
          agelimit(); 

          PHP Code:
          function getage($birthdate

             list(
          $day$month$year) = split('-',  $birthdate); 
                        
          $tmonth date('n'); 
                        
          $tday date('j'); 
                        
          $tyear date('Y'); 
                        
          $years $tyear $year
                        if (
          $tmonth <= $month
                        { 
                        if (
          $month == $tmonth
                        { 
                        if (
          $day $tday)$years--; 
                         } 
                         else 
          $years--; 
                         } 

                     return 
          $years

          PHP Code:
          function agelimit($text)
          {
          $age mysql_fetch_array(mysql_query("SELECT age FROM YOURBASE WHERE id='".$id." ' "));
          echo 
          mysql_error();
          $isage getage($age[0]);
          if(
          $isage<18)
          {
                  echo 
          "<br/>You have to be 18+ to view this place.<br/>";
          }

          thanks sub but where do i put all this i am trying to put it on my galley/index.php page for malex and femalex
          HELP THEM WHO HELPS YOU



          i only work on wapdesire v_2 coding only

          Comment


            #6
            Well use this
            if($isadult == "yes");
            {
            echo agelimit();
            }else{
            Your content here for adults only...
            }


            As seen on chat4u.mobi

            fourms / downloads / gallery / chat has adult now they are blocked...
            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
            Visit: WapMasterz Coming Back Soon!
            _______
            SCRIPTS FOR SALE BY SUBZERO
            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
            _______
            Info & Tips
            php.net
            w3schools.com

            Comment


              #7
              just try it now

              $age = 16; /*Required Age*/$date = getdate();
              $year = $date['year'];
              $_POST['YearOfBirth']
              if ($year – $_POST['YearOfBirth'] >= $age)
              {
              header("Location: http://yourdomain.com/index.php");
              }
              else
              {
              die("you can not access this part");
              }
              ?>

              Comment


                #8
                or just dont allow minors on your site, they're only gonna get to that page and then go and change their age in the settings lol so i'd suggest no minors or no adult content

                Comment


                  #9
                  +++100 ++++ for woody !!

                  Well said...

                  but how they will change name on my site when i dont let users edit there bday once they enter thats it lol
                  Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                  Visit: WapMasterz Coming Back Soon!
                  _______
                  SCRIPTS FOR SALE BY SUBZERO
                  Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                  FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                  _______
                  Info & Tips
                  php.net
                  w3schools.com

                  Comment


                    #10
                    try this one
                    PHP Code:
                    <?php
                    $age 
                    16/*Required Age*/
                    $date getdate();
                    $year $date['year'];
                    /*Assuming $_POST['YearOfBirth'] is the year of birth specified by the user*/
                    $yob=$_POST['YearOfBirth'];
                    if (
                    $year – $yob >= $age){ 
                    /* Redirect to your homepage */
                    header("Location: http://yourdomain.com/index.php"); 
                    /*Change http://yourdomain.com/index.php to your home page*/
                    }
                    else{
                    die(
                    "you can not access this part"); 
                    }
                    ?>
                    Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

                    Comment


                      #11
                      lol only way to truely block people under 18 is to use credit card authorization upon signing up, but thats a big no no on wap
                      or if your really anal about it request photo id and ****, but that's the gay way

                      Comment

                      Working...
                      X