session_start() or cookie?

Community Forums Forums General Discussion session_start() or cookie?

This topic is: resolved

Tagged: , ,

This topic contains 1 reply, has 2 voices, and was last updated by  Susan 1 year, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38747

    mathiasppc
    Participant
    Post count: 27

    Any help is greatly appreciated!

    Im trying to load a script once, then use the variable $country_code a couple of times on each page. Heres the script:

    <code>

    <?php require_once(“geoip.inc”);
    $gi = geoip_open(“GeoIP.dat”,GEOIP_STANDARD);
    $country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
    geoip_close($gi);

    </code>

    Where do I put this code in Genesis? How do I make sure that I can use the variable $country_code (without having to load the script over and over)?

    I browsed around on the net last night to come up with solutions, and I found something about using session_start() or cookies, but I can`t get it to work…

    And lastly, how will the speed of my website suffer by using PHP in posts and pages vs. JS?

    • This topic was modified 1 year, 2 months ago by  mathiasppc.
    • This topic was modified 1 year, 2 months ago by  mathiasppc.
    http://energyinformative.org/genesis
    #47569

    Susan
    Moderator
    Post count: 7991

    Closing this topic, as it was marked as “resolved”


    Susan @ Graphically Designing I’d love to customize your website! I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘session_start() or cookie?’ is closed to new replies.