웹프로그래밍

Global It Leader!!


PHP


 
 

localStorage 활용방법

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 3,478회 작성일 16-06-25 14:25

본문

<?
// Save an item to the local storage
function set_key($key, $data)
 {
     echo "<script language='Javascript'>localStorage.setItem('$key', '$data');</script>";
  return $this;
 }

// Get an item from the local storage (basic implementation)
function get_key($key)
{
 echo "<script language='Javascript'>return localStorage.getItem('$key'));</script>";
}

// Remove an item from the local storage
function delete_key($key)
{
    echo "<script language='Javascript'>return localStorage.getItem('$key');</script>";
}
    
// Clear the local storage
function clear_key()
{
    echo "<script>localStorage.clear();</script>";
}             
?>

<script>
function get_key(key) {
 return localStorage.getItem(key);
}
</script>
<?
set_key("ck_mb_id", "test");

$tmp_mb_id = "<script>document.write(get_key('ck_mb_id'));</script>";

echo "당신의 아이디는?".$tmp_mb_id;

?>

댓글목록

등록된 댓글이 없습니다.

전체 80
게시물 검색
PHP 목록
번호 제목 글쓴이 조회 날짜
60 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3463 10-19
59 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2717 10-22
58 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2626 05-14
57 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3174 02-22
56 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2736 02-22
55 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2604 02-22
54 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3072 12-09
53 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2789 09-23
52 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2648 09-21
51 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2719 08-29
50 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2631 08-06
49 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2875 01-04
48 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2882 06-23
47 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2845 04-07
46 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4530 03-19
45 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2899 09-29
열람중 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3479 06-25
43 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3195 11-11
42 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3470 07-01
41 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4193 05-21