Gamexeon.com : Situs, Portal dan Forum Komunitas PC, Online, Handheld, dan Video Games Indonesia home
Gamexeon.com : Situs, Portal dan Forum Komunitas PC, Online, Handheld, dan Video Games Indonesia Logo

Computer Science Programming, System Design, etc


Selamat datang di Gamexeon Forum !

Saat ini kamu sepertinya masih menjadi tamu saja yang hanya dapat memanfaatkan situs ini secara terbatas. Dengan bergabung bersama kami, kamu dapat menanyakan semuanya mulai dari panduan sebuah game sampai utak atik game dan hardware. Banyak fitur lain seperti blogging, fasilitas realtime feeds, video post, poll dan lain sebagainya sebagai sarana diskusi juga disertakan dan siap digunakan oleh siapapun. Registrasinya cepet dan gampang kok, nggak bertele tele, makanya itu daftar sekarang!

Kalo ada masalah mengenai pendaftaran dan lain sebagainya, hubungi kami segera.
Kalau mau lihat index forum aktif yang sedang melakukan diskusi, kamu bisa klik disini .
Kalau mau tau apa saja yang sedang berlangsung di GX secara realtime, kamu bisa klik Newpost. Nggak usah di tutup lagi, nanti dia update sendiri :)

Reply
 
LinkBack Thread Tools Display Modes
Old
  (#1 (permalink))
GiFos (Offline)
Senior Member
GiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura about
 
GiFos's Avatar
 
Posts: 7,025
Join Date: Nov 2003
Rep Power: 22
Points: 28,895 (Donate)


Points: 41,410, Level: 21
Points: 41,410, Level: 21 Points: 41,410, Level: 21 Points: 41,410, Level: 21
Level up: 39%, 2,540 Points needed
Level up: 39% Level up: 39% Level up: 39%
Activity: 69%
Activity: 69% Activity: 69% Activity: 69%

Question Php...php...php... - 08-08-07, 12:33

Anu...variabel array (array yang isinya dinamis, bukan array statik) bisa dimasukkan ke Session nggak sih? ^^;;; Keliatannya nggak bisa ya? Sudah nyoba kode seperti :

Code:
session_start();
 $chosen_site = serialize($array);
 session_register('chosen_site');
Hasilnya arraynya cuman 1, kalau gwe masukin nilai baru maka nilai sebelumnya ketiban.

atau

Code:
session_start();
session_register('chosen_site[]');
Yang ini malah error ...

Any enlightement?


Machines aren't capable of evil. Humans make them that way. Lucca - Chrono Trigger.

There is no such thing as idle time. Any time one person is watching TV, another person is reading, studying, exercising, and otherwise getting ahead of the loser in front of the TV. Any time spent in front of TV is time that's putting one further and further behind. Ken Rockwell - KenRockwell.com.
   
Reply With Quote

Sponsored Links
Your Ad Here

Old
  (#2 (permalink))
white_tiger (Offline)
Gamexeon Boss
white_tiger will become famous soon enoughwhite_tiger will become famous soon enoughwhite_tiger will become famous soon enoughwhite_tiger will become famous soon enough
 
white_tiger's Avatar
 
Posts: 5,463
Join Date: Jun 2005
Location: Sidoarjo
Rep Power: 16
Points: 17,504 (Donate)


Points: 47,111, Level: 22
Points: 47,111, Level: 22 Points: 47,111, Level: 22 Points: 47,111, Level: 22
Level up: 74%, 1,139 Points needed
Level up: 74% Level up: 74% Level up: 74%
Activity: 13%
Activity: 13% Activity: 13% Activity: 13%

08-08-07, 15:25

session_register('aa');
$bb[1]="Abc";
$bb[2]="def";
$_SESSION['aa']=$bb;



Inet is my campus, Google is my teacher, Wikipedia is my book - Iwe 2007
Nothing can make money as good as money itself - Iwe 2008

jangan ngejunk selain di freechat
   
Reply With Quote
Old
  (#3 (permalink))
GiFos (Offline)
Senior Member
GiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura about
 
GiFos's Avatar
 
Posts: 7,025
Join Date: Nov 2003
Rep Power: 22
Points: 28,895 (Donate)


Points: 41,410, Level: 21
Points: 41,410, Level: 21 Points: 41,410, Level: 21 Points: 41,410, Level: 21
Level up: 39%, 2,540 Points needed
Level up: 39% Level up: 39% Level up: 39%
Activity: 69%
Activity: 69% Activity: 69% Activity: 69%

09-08-07, 13:07

Itu kan "predetermined" array , emang bisa kalau itu. Tapi gwe pengennya Array yang dinamis . Seperti code di bawah ini...

Code:
<?php
 session_start();
 $_SESSION['sesid'] = session_id();
 echo $_SESSION['sesid'];
?>

<?php
if (!isset($_SESSION['array'])) {
  $_SESSION['array'] = 1;
}

$bb[$_SESSION['array']] = "test";
$_SESSION['array']++;

$_SESSION['chosensite'] = $bb;

$_SESSION['count']++;
echo $_SESSION['count'];

echo"</br>";
echo"</br>";
echo"</br>";

print_r($_SESSION["chosensite"]);
Hasil print_r nya :
Refresh browser pertama kali --- Array ( [1] => test )
Refresh browser kedua kali --- Array ( [2] => test )
Refresh browser ketiga kali --- Array ( [3] => test )
...dst

Gwe pengennya :
Refresh browser pertama kali --- Array ( [1] => test )
Refresh browser kedua kali --- Array ( [1] => test [2] => test )
Refresh browser ketiga kali --- Array ( [1] => test [2] => test [3] => test )
...dst ...

Ini ada kode yang kurang apa logika gwe yang ngaco apa PHP emang nggak full support Array di Session? ? Malah kalau make database aja malah gampang . Embuh ah, mo makan dulu...laper ...


Machines aren't capable of evil. Humans make them that way. Lucca - Chrono Trigger.

There is no such thing as idle time. Any time one person is watching TV, another person is reading, studying, exercising, and otherwise getting ahead of the loser in front of the TV. Any time spent in front of TV is time that's putting one further and further behind. Ken Rockwell - KenRockwell.com.

Last edited by GiFos; 09-08-07 at 13:12.
   
Reply With Quote
Old
  (#4 (permalink))
white_tiger (Offline)
Gamexeon Boss
white_tiger will become famous soon enoughwhite_tiger will become famous soon enoughwhite_tiger will become famous soon enoughwhite_tiger will become famous soon enough
 
white_tiger's Avatar
 
Posts: 5,463
Join Date: Jun 2005
Location: Sidoarjo
Rep Power: 16
Points: 17,504 (Donate)


Points: 47,111, Level: 22
Points: 47,111, Level: 22 Points: 47,111, Level: 22 Points: 47,111, Level: 22
Level up: 74%, 1,139 Points needed
Level up: 74% Level up: 74% Level up: 74%
Activity: 13%
Activity: 13% Activity: 13% Activity: 13%

09-08-07, 14:26

mungkin bisa dikeluarin dulu ke variable baru dimasukin lagi ke session



Inet is my campus, Google is my teacher, Wikipedia is my book - Iwe 2007
Nothing can make money as good as money itself - Iwe 2008

jangan ngejunk selain di freechat
   
Reply With Quote
Old
  (#5 (permalink))
GiFos (Offline)
Senior Member
GiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura about
 
GiFos's Avatar
 
Posts: 7,025
Join Date: Nov 2003
Rep Power: 22
Points: 28,895 (Donate)


Points: 41,410, Level: 21
Points: 41,410, Level: 21 Points: 41,410, Level: 21 Points: 41,410, Level: 21
Level up: 39%, 2,540 Points needed
Level up: 39% Level up: 39% Level up: 39%
Activity: 69%
Activity: 69% Activity: 69% Activity: 69%

11-08-07, 14:39

Maksudnya?


Machines aren't capable of evil. Humans make them that way. Lucca - Chrono Trigger.

There is no such thing as idle time. Any time one person is watching TV, another person is reading, studying, exercising, and otherwise getting ahead of the loser in front of the TV. Any time spent in front of TV is time that's putting one further and further behind. Ken Rockwell - KenRockwell.com.
   
Reply With Quote
Old
  (#6 (permalink))
white_tiger (Offline)
Gamexeon Boss
white_tiger will become famous soon enoughwhite_tiger will become famous soon enoughwhite_tiger will become famous soon enoughwhite_tiger will become famous soon enough
 
white_tiger's Avatar
 
Posts: 5,463
Join Date: Jun 2005
Location: Sidoarjo
Rep Power: 16
Points: 17,504 (Donate)


Points: 47,111, Level: 22
Points: 47,111, Level: 22 Points: 47,111, Level: 22 Points: 47,111, Level: 22
Level up: 74%, 1,139 Points needed
Level up: 74% Level up: 74% Level up: 74%
Activity: 13%
Activity: 13% Activity: 13% Activity: 13%

11-08-07, 15:06

ya isinya session itu dimasukin ke variable, baru variabelnya diutik2.... terus kalo udah dimasukin ke $_Session lagi....



Inet is my campus, Google is my teacher, Wikipedia is my book - Iwe 2007
Nothing can make money as good as money itself - Iwe 2008

jangan ngejunk selain di freechat
   
Reply With Quote
Old
  (#7 (permalink))
GiFos (Offline)
Senior Member
GiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura aboutGiFos has a spectacular aura about
 
GiFos's Avatar
 
Posts: 7,025
Join Date: Nov 2003
Rep Power: 22
Points: 28,895 (Donate)


Points: 41,410, Level: 21
Points: 41,410, Level: 21 Points: 41,410, Level: 21 Points: 41,410, Level: 21
Level up: 39%, 2,540 Points needed
Level up: 39% Level up: 39% Level up: 39%
Activity: 69%
Activity: 69% Activity: 69% Activity: 69%

Talking 12-08-07, 15:39

Hey, you're right . Sekarang bisa ^^;;; Tenkyu bos :-p...

Bagi yang lain yang mo liat kodenya, walaupun masih belum efisien, dasarnya seperti di bawah ini :
Code:
<?php
 session_start();
 $_SESSION['sesid'] = session_id();
 echo $_SESSION['sesid'];
?>


<?php
if (!isset($_SESSION['array'])) {
  $_SESSION['array'] = 1;
  $bb[$_SESSION['array']] = "test";
  $_SESSION['chosensite'] = $bb;
  echo "</br>";
  echo "</br>";
  echo "Isi chosen site di isset = ";
  print_r($_SESSION["chosensite"]);
}
else {
    for ($i = 1; $i <= $_SESSION['array']; $i ++) {
     echo "</br>";
     echo "</br>";
     echo "Isi chosen site di for loop = ";
     print_r($_SESSION["chosensite"]);
     $aa = $_SESSION['chosensite'];
     echo "</br>";
     echo "</br>";
     echo "Isi aa di for loop = ";
     print_r ($aa);
     $bb[$i] = $aa[$i];
     echo "</br>";
     echo "</br>";
     echo "Isi bb di for loop = ";
     print_r ($bb);
    }
 $_SESSION['array']++;
 $bb[$_SESSION['array']] = "test";
 $_SESSION['chosensite'] = $bb;
 echo "</br>";
 echo "</br>";
 echo "Isi chosen site di else = ";
 print_r($_SESSION["chosensite"]);
}

echo"</br>";
echo"</br>";
echo"</br>";

print_r($_SESSION["chosensite"]);
?>


Machines aren't capable of evil. Humans make them that way. Lucca - Chrono Trigger.

There is no such thing as idle time. Any time one person is watching TV, another person is reading, studying, exercising, and otherwise getting ahead of the loser in front of the TV. Any time spent in front of TV is time that's putting one further and further behind. Ken Rockwell - KenRockwell.com.

Last edited by GiFos; 12-08-07 at 15:42.
   
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
Template-Modifikationen durch TMS