Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    151
    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:
    166
    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:
    769
    Likes Received:
    2
    Trophy Points:
    168
    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");
    }
    ?>
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #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:
    166
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice