• 13-04-2017, 08:19:09
    #1
    Üyeliği durduruldu
    {"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}

    arkadaşlar postlanan veri bu fakat ben sadece
    access_token kısmındaki testt , yani token kodunu almak istiyorum, aşağıdaki şekilde malesef olmadı
    "access_token":"TESTTTTTTTTTTTTTTT"


    # Gelen / Parcala
    $tokenMy= htmlspecialchars($_POST['postToken']);
    $tokenMy= explode('access_token',$tokenMy);
    $tokenMyx= $tokenMy[1];
    $tokenMyx= explode('expires_in',$tokenMyx);
    $accessToken = $tokenMyx[0];
  • 13-04-2017, 09:19:57
    #2
    Nutur adlı üyeden alıntı: mesajı görüntüle
    {"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}

    arkadaşlar postlanan veri bu fakat ben sadece
    access_token kısmındaki testt , yani token kodunu almak istiyorum, aşağıdaki şekilde malesef olmadı
    "access_token":"TESTTTTTTTTTTTTTTT"


    # Gelen / Parcala
    $tokenMy= htmlspecialchars($_POST['postToken']);
    $tokenMy= explode('access_token',$tokenMy);
    $tokenMyx= $tokenMy[1];
    $tokenMyx= explode('expires_in',$tokenMyx);
    $accessToken = $tokenMyx[0];

    Hocam öncelikle bu vermiş olduğunuz üstteki kısım bir json formatı. bu yüzden bu bölümden bir değeri explode kullanarak almak adeta kulağı tersten tutmak değil; kulağı bacaklarının arasından dolandırdıktan sonra belinin arkasından geçirip tutmak gibi birşey.

    işte aşağıda yapmanız gereken:
    $str = '{"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}';
    
    $data = json_decode($str, true);
    
    // $data artık bir array oldu. içinden istediğimiz değeri, değerin key'i ile alabiliriz.
    echo $data["access_token"]; // access_token'ı yazar,
    echo $data["session_key"]; // session key'i yazar,
    //gibi örnekleri çoğaltabiliriz.
    
    echo "<pre>;
    print_r($data);
    echo "</pre>;
    //bu işlem ile array'in içini görüntüleyip key-value çiftlerini görebilirsiniz.
    Bol şans.
  • 13-04-2017, 09:23:45
    #3
    Nutur adlı üyeden alıntı: mesajı görüntüle
    {"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}

    arkadaşlar postlanan veri bu fakat ben sadece
    access_token kısmındaki testt , yani token kodunu almak istiyorum, aşağıdaki şekilde malesef olmadı
    "access_token":"TESTTTTTTTTTTTTTTT"


    # Gelen / Parcala
    $tokenMy= htmlspecialchars($_POST['postToken']);
    $tokenMy= explode('access_token',$tokenMy);
    $tokenMyx= $tokenMy[1];
    $tokenMyx= explode('expires_in',$tokenMyx);
    $accessToken = $tokenMyx[0];

    elinizdeki veri json verisi;

    $x = '{"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}';
    
    $y = json_decode($x);
    echo $y->access_token;
    şeklinde alabilirsiniz.
  • 13-04-2017, 10:10:53
    #4
    Üyeliği durduruldu
    mpoy8 adlı üyeden alıntı: mesajı görüntüle
    Hocam öncelikle bu vermiş olduğunuz üstteki kısım bir json formatı. bu yüzden bu bölümden bir değeri explode kullanarak almak adeta kulağı tersten tutmak değil; kulağı bacaklarının arasından dolandırdıktan sonra belinin arkasından geçirip tutmak gibi birşey.

    işte aşağıda yapmanız gereken:
    $str = '{"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}';
    
    $data = json_decode($str, true);
    
    // $data artık bir array oldu. içinden istediğimiz değeri, değerin key'i ile alabiliriz.
    echo $data["access_token"]; // access_token'ı yazar,
    echo $data["session_key"]; // session key'i yazar,
    //gibi örnekleri çoğaltabiliriz.
    
    echo "<pre>;
    print_r($data);
    echo "</pre>;
    //bu işlem ile array'in içini görüntüleyip key-value çiftlerini görebilirsiniz.
    Bol şans.
    sehzadem adlı üyeden alıntı: mesajı görüntüle
    elinizdeki veri json verisi;

    $x = '{"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}';
    
    $y = json_decode($x);
    echo $y->access_token;
    şeklinde alabilirsiniz.

    Maalesef ikiside olmadı, olay şu, adam gereken bilgileri yazıyor ve yukarıda ki gibi verileri yazdırıyor daha sonra bunun tümünü 3 eksik 5 fazla artık hesap bilgilerinde hangi çıktılar varsa, bunu kopyalayıp kontrol et butonuna tıklıyor daha sonra bu veri kontrol php dosyasına gelip kontrol ediyor, dodruysa db yazıyor vs.yani geldikten sonra bana sadece access_token de var olan "access_token":"TESTTTT TTTTTTTTTTT" siyah bölüm. kontrol php ye sadece o bölüm işlenmesi lazım, eskiden = ile başlıyordu o kodum aktif calısıyordu



    $tokenMy= htmlspecialchars($_POST['postToken']);
    $tokenMy= explode('=',$tokenMy);
    $tokenMyx= $tokenMy[1];
    $tokenMyx= explode('expires_in',$tokenMyx);
    $accessToken = $tokenMyx[0];

    Şu şekilde fakat şuan access_token":"veri böyle
  • 13-04-2017, 10:29:39
    #5
    Nutur adlı üyeden alıntı: mesajı görüntüle
    Maalesef ikiside olmadı, olay şu, adam gereken bilgileri yazıyor ve yukarıda ki gibi verileri yazdırıyor daha sonra bunun tümünü 3 eksik 5 fazla artık hesap bilgilerinde hangi çıktılar varsa, bunu kopyalayıp kontrol et butonuna tıklıyor daha sonra bu veri kontrol php dosyasına gelip kontrol ediyor, dodruysa db yazıyor vs.yani geldikten sonra bana sadece access_token de var olan "access_token":"TESTTTT TTTTTTTTTTT" siyah bölüm. kontrol php ye sadece o bölüm işlenmesi lazım, eskiden = ile başlıyordu o kodum aktif calısıyordu



    $tokenMy= htmlspecialchars($_POST['postToken']);
    $tokenMy= explode('=',$tokenMy);
    $tokenMyx= $tokenMy[1];
    $tokenMyx= explode('expires_in',$tokenMyx);
    $accessToken = $tokenMyx[0];

    Şu şekilde fakat şuan access_token":"veri böyle

    Hocam eğer çalışmıyorsa mutlaka bir yerde hata yapıyorsunuz, bu veri formdan geliyorsa karakter süzme fonksiyonlarından geçiyor olabilir, noktalama işaretlerinde de problem yaşıyor olabilirsiniz. Ama çalışmaması imkansız.

    $str = '{"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}';
    $data = json_decode($str, true);
    echo $data["access_token"];
    Yukarıdaki işlemi localhostta çalıştırın sonucu göreceksiniz.
    ha illaki token'ı ben explode ile alacağım diyorsanız o da aşağıdaki şekilde olur.
    $str = '{"session_key":"asfF492060526.14-123213123","uid":100008494060899,"secret":"1f95553 2227e0badab8550c6b68b106c","access_token":"TESTTTT TTTTTTTTTTT","machine_id":"gdfs-","session_cookies":[{"name":"c_user","value":"asf","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"xs","value":"14:MGqy8GDN NBXH-A:2:1492060526:12935","expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/","secure":true},{"name":"fr","value":"32423434.AW UF-R1Qd5r-okwGpzc5qEFG1cM.BY7wlu..AAA.0.0.BY7wlu.AWVsZyX4"," expires":"Fri, 13 Apr 2018 05:15:26 GMT","expires_timestamp":1523596526,"domain":".fac ebook.com","path":"\/"},{"name":"datr","value":"bgnvWM7cfxSdXQhCUXx D9De-","expires":"Sat, 13 Apr 2019 05:15:26 GMT","expires_timestamp":1555132526,"domain":".fac ebook.com","path":"\/","secure":true}],"confirmed":true,"identifier":"yunusakanya","user _storage_key":"324324324"}';
    $new= explode('"access_token":"',$str);
    $new2= explode('","',$new[1]);
    echo $new2[0]; // token ı yazdırır.
    edit 1:
    htmlspecialchars() fonksiyonunu veri girişinde değil çıkışında kullanmalısınız. bazı best practise leri öğrenmeniz açısından size bir kaynak öneriyorum.

    Aşağıdaki linkteki bilgileri okuyarak bir çok konuda çok daha deneyimli olabilirsiniz.

    aristona.github.io/web-gelistiricilerin-bilmesi-gereken-konular