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, 11 months ago.

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


    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:


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


    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 2 years ago by  mathiasppc.
    • This topic was modified 2 years ago by  mathiasppc.


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

    Susan @ Graphically Designing I offer theme customizations 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.