#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    5
    Rep Power
    0
    Well, I wrote two code like this on my Win98 + PWS + PHP 4.0.1:
    index.php
    <?
    session_register("counter");
    $counter="Test";
    printf('<a href="index2.php?%s">Link</a>', SID);
    ?>
    index2.php:
    <?
    session_start();
    echo $counter;

    ?>

    And I get empty result just like $counter wasn't seted when I loaded index2.php.
    I've heard that php session variables can not be changed, it's ok to me, but I don't think a session function without variable-passing ability should be called a "session".
    Any suggestion? I've buzzing on this problem over 48 hours, I want use this to track my member 'logged' and act without cookie.
    BTW, my php.ini is almost setting on the default value, besides the session.save_path.

    [This message has been edited by eggli (edited June 29, 2000).]
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    59
    Rep Power
    15
    I don't know anything about sessions in php4, but I did notice a problem in your code that could give you that problem.
    You have session_register("counter");
    it should be session_register("$counter");

    Hope that helps
    Chris
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    5
    Rep Power
    0
    Well, thanks for the reply anyway, I've tried ur suggestion many times b4 I post, even like these:
    session_register($counter);
    session_register("$counter");
    session_register("counter");
    session_register(counter);

    And all documentation I've read b4 this post are all writing in this format:
    session_register("counter");

    ------------------
    What're material of a programmer?
    Coffin and Coffeine.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    32
    Rep Power
    15
    You need session_start() in index.php before your session_register().
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    5
    Rep Power
    0
    Well, I've read so many article talk about session, all of them are saying once I register a variable to session, the session will automatically began...

    And 48 hours(more than it now) is long enough to try every writing combination.

    [This message has been edited by eggli (edited June 30, 2000).]

Similar Threads

  1. refreshing page on session
    By xlordt in forum PHP Development
    Replies: 3
    Last Post: August 26th, 2003, 04:28 PM
  2. reading existing session, problem
    By buttie in forum Perl Programming
    Replies: 7
    Last Post: August 11th, 2003, 11:26 AM
  3. session start issue!
    By djl in forum PHP Development
    Replies: 0
    Last Post: July 29th, 2003, 02:37 PM
  4. PATH_INFO URL - Search Engine Friendly
    By Coopercentral2 in forum PHP Development
    Replies: 2
    Last Post: April 19th, 2003, 11:44 PM
  5. anonFTP hack?
    By (jp) in forum FTP Help
    Replies: 3
    Last Post: March 10th, 2003, 02:58 PM

IMN logo majestic logo threadwatch logo seochat tools logo