Ada yang tau soal Cookies?

Discussion in 'Desain Web dan Programming' started by rudyjog, 26 May 2009.

Thread Status:
Not open for further replies.
  1. rudyjog

    rudyjog Beginner 1.0

    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Selamat pagi semua. Mohon masukan dari teman2.
    Website saya saat ini muncul error message seperti ini :
    Warning: session_start() [function.session-start]: open(/path/sess_1a23e6a24f1a64cc1b5b89a70d6c1bcb, O_RDWR) failed: No such file or directory (2) in /home/uangkage/public_html/sponsor.php on line 4

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 4

    Apa ada yg tau gimana cara memperbaikinya? Apakah setting cookie dari administrator berpengaruh terhadap akses website? Di web saya setting cookie saat ini 30 hari, apakah itu masalahnya?
    Please help me.....
     
  2. frozts91

    frozts91 Poster 2.0

    Messages:
    159
    Likes Received:
    1
    Trophy Points:
    18
    tidak ada file sessionnya kalau ini.

    kalau yang ini
    biasanya terjadi dimana script yang harus nya membutuhkan sesi pertama untuk menyimpan suatu sesi di web browser kedahuluan oleh sesi yang dihasilkan sciprt lain. solusinya coba dituker tempat saja. :)

    kalau boleh bisa disertain code php dari sponsor.php, biar saya bisa tahu
     
  3. rudyjog

    rudyjog Beginner 1.0

    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cara tuker t4 gmn bro?
    ini code dari sponsor.php web saya :
    <?php
    include("globals.php");

    session_start();

    $sponsor_level1_cookie = $HTTP_COOKIE_VARS['level1'];
    $random_sponsor_cookie = $HTTP_COOKIE_VARS['rsponsor'];





    $cookie_expired = time() + $conf['expires'] * 60 * 60 * 24 ;


    if (session_is_registered("sponsor_level1") and session_is_registered("random_sponsor")) {

    if (isset($id)) {
    if (read_aktif($id)) {

    setcookie ("level1", $id, $cookie_expired);

    $sponsor_level1 = $id;
    write_stats($id);
    } else {
    $sponsor_level1 = make_sponsor();
    setcookie ("level1", $sponsor_level1, $cookie_expired);
    }


    }
    return true;
    } else {


    if (isset($sponsor_level1_cookie)) {
    if (read_aktif($sponsor_level1_cookie)) $sponsor_level1 = $sponsor_level1_cookie;
    else
    {
    $sponsor_level1 = make_sponsor();
    setcookie ("level1", $sponsor_level1, $cookie_expired);
    }
    } else {
    $sponsor_level1 = make_sponsor();
    setcookie ("level1", $sponsor_level1, $cookie_expired);
    }


    if (isset($id)) {
    if (read_aktif($id)) {

    setcookie ("level1", $id, $cookie_expired);

    $sponsor_level1 = $id;
    write_stats($id);
    } else {
    $sponsor_level1 = make_sponsor();
    setcookie ("level1", $sponsor_level1, $cookie_expired);
    }
    }



    if ($conf['rsponsor'] == 1) {


    if (isset($random_sponsor_cookie)) {
    if (read_aktif($random_sponsor_cookie)) $random_sponsor = $random_sponsor_cookie;
    else
    {
    $random_sponsor = make_sponsor();
    setcookie ("rsponsor", $random_sponsor, $cookie_expired);
    }
    } else {
    $random_sponsor = make_sponsor($sponsor_level1);
    setcookie ("rsponsor", $random_sponsor, $cookie_expired);
    }


    if ($sponsor_level1 == $random_sponsor) {
    $random_sponsor = make_sponsor($sponsor_level1);
    setcookie ("rsponsor", $random_sponsor, $cookie_expired);
    }
    }


    session_register("sponsor_level1");
    session_register("random_sponsor");
    }



    function make_sponsor($except = '') {
    global $conf;
    srand((double)microtime() * 10000000);
    $qdb = "SELECT * FROM members WHERE `userlevel`='1' AND `userid` != '$except' ORDER BY RAND()";

    $qres = mysql_db_query($conf['dbname'], $qdb) or display_html(mysql_error(), "error.html");
    if (mysql_num_rows($qres)) {

    $out = array();
    while ($row = mysql_fetch_array($qres)) {

    $i = 1;
    while ($i < $row['rotation']) {
    $out[] = $row['userid'];
    $i++;
    }
    }
    $rand_keys = array_rand($out, 1);
    $sponsor = $out[$rand_keys];
    }

    return $sponsor;
    }

    ?>
     
  4. ruangweb

    ruangweb (Ret) Community Leader

    Messages:
    688
    Likes Received:
    6
    Trophy Points:
    18
    itu karena variabel session.save_path-nya kosong atau salah, tentuin/definisikan dalam script tsb atau lewat php.ini atau htaccess
     
  5. frozts91

    frozts91 Poster 2.0

    Messages:
    159
    Likes Received:
    1
    Trophy Points:
    18
    nah dibagian ini ditukar tempatnya. jadi seperti

    dicoba saja bos, semoga berhasil :D
     
  6. rudyjog

    rudyjog Beginner 1.0

    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    caranya saya harus ketik apa di htaccess? saya masih awam nih soal ginian.
    ini code htacces saya :
    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName uangkaget.biz
    AuthUserFile /home/uangkage/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/uangkage/public_html/_vti_pvt/service.grp
    php_flag register_globals on
     
  7. rudyjog

    rudyjog Beginner 1.0

    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Tidak bisa bro... sudah saya coba tukar tempat, tapi tetap aja muncul warning error yang sama.
     
  8. ruangweb

    ruangweb (Ret) Community Leader

    Messages:
    688
    Likes Received:
    6
    Trophy Points:
    18
    tambahin ini (ini hanya efektif kalo php terpasang sebagai modul apache)
    Code:
    php_value session.save_path "/home/[I]namauser[/I]/[B]ganti/ini/dgn/lokasi/yang/benar[/B]"
     
  9. rudyjog

    rudyjog Beginner 1.0

    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Sudah saya coba bos. Tapi tetap muncul error message ini :
    Warning: session_start() [function.session-start]: open(/home/uangkage/public_html/sess_b0c39b997b37447456ba3506fe2da019, O_RDWR) failed: Permission denied (13) in /home/uangkage/public_html/sponsor.php on line 4

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 4

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 4

    Warning: Cannot modify header information - headers already sent by (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 45
     
  10. ruangweb

    ruangweb (Ret) Community Leader

    Messages:
    688
    Likes Received:
    6
    Trophy Points:
    18
    baca dulu dokumentasinya bos, link-nya udah dikasih tuh di atas
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...