답변이 늦었습니다.
test.php의 내용은 아래와 같읍니다.
<?
// 세션의 초기화
session_start();
// 설정 값이 먼저와야 합니다.
$num_of_tries = "1";
$guessed_chars = "2";
$word = "fail";
// 변수를 등록한다.
session_register("num_of_tries");
session_register("guessed_chars");
session_register("word");
?>
<?
session_start();
echo session_id(); // 또는 $PHPSESSID
// 아래와 같이 $_SESSION["세션변수이름"];
echo $_SESSION["num_of_tries"];
// 또는 $HTTP_SESSION_VARS["세션변수이름"]
?>
그리고 /tmp 디렉토리에 'sess_세션ID이름' 파일이 있는지 확인해 보세요.
이런 파일이 없으면 세션으로 등록되지 않은 경우입니다.
아래에 마침 간단한 예제가 있군요.
http://www.phpschool.com/bbs2/inc_view.html?id=3528&code=tnt2
===========================================
[darkrabbit]님이 남기신 글:
>안녕하세요.
>다름이 아니라 섹션에서 해결하지 못하고있는 문제가 있어서 이렇게 도움을 요청합니다.
>리눅스에서 섹션은 /tmp 및에 생성은 되는데, 섹션 변수값을 불러오면 아무것도 나오지 않습니다.
>=============================================================test.php
>test.php의 내용은 아래와 같읍니다.
><?
>// 세션의 초기화
>session_start();
>
>// 변수를 등록한다.
>
>session_register("num_of_tries");
>
>session_register("guessed_chars");
>
>session_register("word");
>
>$num_of_tries = "1";
>$guessed_chars = "2";
>$word = "fail";
>
>?>
>=============================================================testresult.php
>testresult.php의 내용은 다음과 같습니다
><?
>session_start();
>
>echo "
> $num_of_tries <br>
> $guessed_chars <br>
> $word <br>";
>
>?>
>====================================================================php.ini
>참고로 저의 php.ini 파일의 섹션 설정부분은 아래와 같읍니다.
>[Session]
>session.save_handler = files ; handler used to store/retrieve data
>session.save_path = /tmp ; argument passed to save_handler
> ; in the case of files, this is the
> ; path where data files are stored
>session.use_cookies = 1 ; whether to use cookies
>session.name = PHPSESSID
> ; name of the session
> ; is used as cookie name
>session.auto_start = 0 ; initialize session on request startup
>session.cookie_lifetime = 600 ; lifetime in seconds of cookie
> ; or if 0, until browser is restarted
>session.cookie_path = / ; the path the cookie is valid for
>session.cookie_domain = ; the domain the cookie is valid for
>session.serialize_handler = php ; handler used to serialize data
> ; php is the standard serializer of PHP
>session.gc_probability = 100 ; percentual probability that the
> ; 'garbage collection' process is started
> ; on every session initialization
>session.gc_maxlifetime = 1440 ; after this number of seconds, stored
> ; data will be seen as 'garbage' and
> ; cleaned up by the gc process
>session.referer_check = ; check HTTP Referer to invalidate
> ; externally stored URLs containing ids
>session.entropy_length = 0 ; how many bytes to read from the file
>session.entropy_file = ; specified here to create the session id
>; session.entropy_length = 16
>; session.entropy_file = /dev/urandom
>session.cache_limiter = nocache ; set to {nocache,private,public} to
> ; determine HTTP caching aspects
>session.cache_expire = 1 ; document expires after n minutes
>session.use_trans_sid = 1 ; use transient sid support if enabled
> ; by compiling with --enable-trans-sid
>url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentr
>y"
>========================================================================
>도저히 무엇이 잘못된건지 알 수가 없군요.
>무지한 저에게 한가닥 희망을 주시면 감사하겠읍니다.
>
>배파판은 wowlinux 7.1 입니다.
======================================== |