1.php
<?
session_start();
$check="hello world";
session_register(check);
echo $check;
?>
<a href="2.php">2.php</a>
2.php
<? 
session_start();
echo $check;
?>在tmp目录下能看到session的ID号,但2.php显示不出来.

解决方案 »

  1.   

    1.php
    <?
    session_start();
    session_register("check");
    $check="hello world";
    ?>
    <a href="2.php">2.php</a>
    2.php
    <? 
    session_start();
    echo $check;
    ?>
    is now ok?
      

  2.   

    在 PHP 中使用 session建立 session:session_start();
    session_register("name");
    $name=BoYu;调用 session:
    session_start();
    echo $name;
      

  3.   

    to boyu(笨鱼) 我按照你的方法,还是不行啊是不是php-4.2.1-Win32.zip
    不支持session.但是/tem/目录的确有session的id啊.
      

  4.   

    今天晚上包页,快速配置了一个apache+php最新
    1.php
    <?
    session_start();
    session_register("check");
    $check="hello world";
    ?>
    <a href="2.php">2.php</a>
    2.php
    <? 
    session_start();
    echo $check;
    ?>
    完全可用
    我改动的的配置玄想
    BindAddress 127.0.0.1
    ServerAdmin [email protected]
    ServerName loaclhost
        DirectoryIndex index.htm 
        DirectoryIndex index.php 
        DirectoryIndex index.php3 
        DirectoryIndex index.php4
    ScriptAlias /php4/ "C:/php4/"
    AddType application/x-httpd-php4 .php
    AddType application/x-httpd-php4 .php3
    AddType application/x-httpd-php4 .php4
    Action application/x-httpd-php4 "/php4/php.exe"
    php.ini中改动如下
    register_globals = On
    然后就可以了,你看看吧