Invisible/visible include....

2 replies
I am making a php project..its made with container with multiple include/require functions (including php pages).

I need that if visitor has a cookie (from my site) he sees different include, or include is visible only if visitor has cookie in his comp...

Cookie will be made with loging in...

If someone has any idea to make this more elegant please help.
#include #invisible or visible
  • Profile picture of the author ussher
    just get the value that you set in the cooke then put in a switch or an IF statement to select the included file.

    $value = $_COOKIE['your_cookie'];
    if($value == 'something_you_set'){
    include 'some_file.php';
    }else{
    include 'some_other_file.php';
    }
    Signature

    "Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."

    - jamroom.net
    Download Jamroom free: Download
    {{ DiscussionBoard.errors[4475698].message }}
  • Profile picture of the author AdWorkMedia
    Exactly, nice work ussher. You could also use $_SESSION['data'] to store data privately rather than on a cookie. Just remember to call session_start(); each time the page uses sessions.
    Signature


    AdWork Media » Global Affiliate Network & Content Locking Solutions

    Custom Platform, Flexible Lockers, Offers For Every Country
    {{ DiscussionBoard.errors[4476197].message }}

Trending Topics