The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disabling Certain Things [Please Help]

Discussion in 'Security' started by donaldmd, May 10, 2007.

  1. donaldmd

    donaldmd Registered

    Joined:
    May 10, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I have a site that you must first agree to terms to on the index1 page. I was wondering if there was anyway I could stop people from entering the index2 by just typing in http://www.domainname.com/index2.php . If anyone could help i'd greatly appreciate it. -Don
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Yes, you could enable hotlink protection in your cpanel. This would throw everyone to the link you specify if they try to bypass it.
     
  3. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    I would set a session variable in php and put a check in the index2 to see if it exists.

    e.g. Agreement page:

    PHP:
    <?php
    session_start
    ();
    session_register("useragreed");
    $_SESSION[useragreed] = "1";
    ?>
    and in index2
    PHP:
    <?php
    session_start
    ()
    if (!isset(
    $_SESSION[useragreed]) or $_SESSION[useragreed] !="1") {
      
    header("Location: index.php");
    }
    ?>
     
    #3 nickp666, May 11, 2007
    Last edited: May 11, 2007
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Good idea or perhaps set a cookie since you may have repeat visitors that have agreed in the past so they can link directly to the content if the cookie exists.
     
Loading...

Share This Page