WordPress.org

Ready to get started?Download WordPress

Forums

Using Cookies in Handmade Scripts (3 posts)

  1. sumeetjain
    Member
    Posted 8 years ago #

    Hi, I'm trying to use a little script I wrote for adding some control over the CSS on a site I run. It's different than the functionality offered by the theme switcher plugins, but the concept is similar.

    If you check out this link: http://fictionfelicis.com/fiction/beta/index.php, you'll see that I basically want to allow users to choose a contract, width, and text size. Based on their selection, a different style sheet is imported. It's working fine on the page above, but as soon as I try to run it in the actual WordPress, it doesn't get the parameters from the URI. Otherwise, it works fine.

    Any help would be much appreciated. Is there perhaps a certain way to use cookies in handmade scripts with WordPress? The code is here: http://fictionfelicis.com/fiction/beta/functions.phps

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    Doing what you wish is certainly possible.
    http://www.alistapart.com/articles/phpswitch/
    The above is one resource, and there is a js method on that site too.

  3. sumeetjain
    Member
    Posted 8 years ago #

    Hi Podz, thanks for the link. I'm actually already aware of ALA's tutorial, but their script isn't exactly what I'm trying to do. And even if it is, I'd like to know what I'm doing wrong in my script that it won't work in WordPress. Otherwise, I'll keep making the same mistakes.

    Anyone have an idea why the script works on a regular page but not in WordPress?

Topic Closed

This topic has been closed to new replies.

About this Topic