SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm wondering, how do i make a global variable in PHP, that would be stored in a cookie ?

    I'd like to make my site skinnable through a PHP stylesheet, and for that i only need to know how to set a global variable... just ONE

    Also, is there a potential security risk using global variables stored in cookies ?
    [blogger: zengun] [blogware contributor: wordpress]

  2. #2
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Open up a PHP session, and store the global variable in the session.

    That way, only the session id (random numbers and letters) gets transmitted over the internet and the global vars that are registered in the session are fetched from the server.

    Try this
    http://www.php.net/manual/en/ref.session.php


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •