SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: SID in URLs

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2001
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SID in URLs

    Okay I have tried finding all sorts of syntax and instructions on using SID, but I can still not figure out how to pass SID and a variable in a URL. The href line looks like:
    PHP Code:
    echo ("<a href='$PHP_SELF?=sid&viewtable=""$tnames"."'">$tnames</a>"); 
    I have tried several other variations as well. Any ideas on how to pass SID along would be appreciated. (W/O Cookies.) Thanks all...

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am guessing here - but I imagine that there is probably something you set in php.ini that determines how the SID is to be passed along - cookies or url?

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remember that SID is a PHP constant and needs to be echoed out like any other var <?=SID?> or <? echo SID; ?>

    You recompile php with --enable-trans-sid this will automatically append the session id to every link on a page where session_start(); is called when cookies are unavailable.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    SitePoint Member
    Join Date
    Oct 2001
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SID in variable url

    I read your thread last night. I've been lookingfor a solution to exactly the same problem.
    After three nights of t&e coding I think I've got it.

    Try this

    <a href=$url?sessionid=$PHPSESSID>add to cart</a>

    don't forget to encapsulate in php tags


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
  •