Session Support  enabled  
Registered save handlers  files user sqlite  
Registered serializer handlers  php php_binary wddx  Directive Local Value Master Value 
session.auto_start Off Off 
session.bug_compat_42 Off Off 
session.bug_compat_warn On On 
session.cache_expire 180 180 
session.cache_limiter nocache nocache 
session.cookie_domain no value no value 
session.cookie_httponly Off Off 
session.cookie_lifetime 0 0 
session.cookie_path / / 
session.cookie_secure Off Off 
session.entropy_file no value no value 
session.entropy_length 0 0 
session.gc_divisor 1000 1000 
session.gc_maxlifetime 1440 1440 
session.gc_probability 1 1 
session.hash_bits_per_character 5 5 
session.hash_function 0 0 
session.name PHPSESSID PHPSESSID 
session.referer_check no value no value 
session.save_handler files files 
session.save_path C:\windows\temp C:\windows\temp 
session.serialize_handler php php 
session.use_cookies On On 
session.use_only_cookies Off Off 
session.use_trans_sid 0 0 
 
-----------------------------------
以上是我的虚拟主机的session的信息!
简单的一句session.start()是没有任何效果的.
-------------------------------------------
在百度搜索上好象要写点session的代码!我没有任何思路!
谢谢,直接贴代码吧!

解决方案 »

  1.   

    php中的 Session 是 session.start()?No1.php
    session_start();
    $_SESSION['Name']='UrPiG';No2.php
    session_start();
    echo $_SESSION['Name'];No3.php
    session_start();
    session_destroy();
    if (!isset($_SESSION['Name'])){
    echo 'UrfAtpIg!';
    }else{
    echo 'aLLpIgS.';
    }
      

  2.   


    楼主要多看看手册....  2楼的正解
    session.start() 看着眼熟啊 
      

  3.   

    就是session_start()啊
    无效啊!
    请多关注
      

  4.   

    <?php 
    session_start();
    for($k=0;$k<8;$k++){
    $rand.=dechex(rand(1,15));
    }
    $_SESSION[check_img]=$rand;
    $img=imagecreatetruecolor(100,20);
    $bgcolor=imagecolorallocate($img,0,0,0);
    $ziti=imagecolorallocate($img,255,255,255);
    imagestring($img,6,rand(1,30),rand(1,5),$rand,$ziti);
    header("Content-type:image/jpeg");
    imagejpeg($img);
    ?>
    -------------
    <?php
    session_start();
    $yanzhengma=$_POST[yanzheng];//表单提交过来的
    if($yanzhengma!=$_SESSION[check_img]){
    echo "验证码有误";
    exit();
    }
    ?>
    -------这里的$_SESSION[check_img]为空值;
    这跟服务器端的PHP.INI的session设置有关!应该是session的保存路径或是么滴!
    代码怎么写呢?闷!!!!!!!!!!!!!!!!!!!!
      

  5.   


    $_SESSION[check_img]=$rand;//你要确定$rand是否有值
                               //$_SESSION[check_img]改成$_SESSION['check_img']
      

  6.   

    $_SESSION[check_img]=$rand
    改成
    $_SESSION['check_img']=$rand 试一试
    记得第二页也要改一下啊