ติดปัญหา Syntax error "Field 1 specified more than once ตอนทำ login facebook

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: ติดปัญหา Syntax error "Field 1 specified more than once ตอนทำ login facebook

Re: ติดปัญหา Syntax error "Field 1 specified more than once ตอนทำ login facebook

โดย บุคคลทั่วไป » 13/12/2022 3:38 pm

มีแบบสำเร็จใช้ลองใช้ไหมครับ

Re: ติดปัญหา Syntax error "Field 1 specified more than once ตอนทำ login facebook

โดย thatsawan » 23/09/2015 12:14 am

รูปแบบ ที่จะขอ
- แบบ ฟิลด์ email ฟิลด์เดียว

โค้ด: เลือกทั้งหมด

function Login_hompage() {
                console.log('Welcome!  Fetching your information.... ');
                FB.api('/me?fields={REGISTER_EMAIL}', function (response) {
               
               
                     });
        } 
- ถ้าต้องการหลายอันให้เพิ่มเเบบนี้

โค้ด: เลือกทั้งหมด

function Login_hompage() {
                console.log('Welcome!  Fetching your information.... ');
                FB.api('/me?fields={REGISTER_EMAIL},{REGISTER_NAME}', function (response) {
               
               
                     });
        } 
ที่สำคัญมันอยู่ที่นี่

onlogin="checkLoginState();"

โค้ด: เลือกทั้งหมด

<li class="facebook_register_logo rightside"  onlogin="checkLoginState();">
        <a href="https://www.facebook.com/dialog/oauth?client_id={APP_ID_FACEBOOK}&redirect_uri={BOARD_URL}{LODE_PAGE}">
                <img src="{IMAGE_REGISTER}" alt="facebook register"> 
        </a>
</li> 

Re: ติดปัญหา Syntax error "Field 1 specified more than once ตอนทำ login facebook

โดย thatsawan » 22/09/2015 6:39 pm

เป็นเพราะมันไม่มี ค่า ไปที่ตัวแปลนั้น

โค้ด: เลือกทั้งหมด

            $this->template->assign_vars(array(
                'REGISTER_EMAIL'    => (empty($this->config['m_register_email'])) ? '' : 'email',
                'REGISTER_NAME'    => (empty($this->config['m_register_name'])) ? '' : 'name',
                'REGISTER_LNG'    => (empty($this->config['m_register_languages'])) ? '' : 'languages',
                'REGISTER_DAY'    =>(empty( $this->config['m_register_birthday'])) ? '' : 'birthday',
            )); 

ติดปัญหา Syntax error "Field 1 specified more than once ตอนทำ login facebook

โดย thatsawan » 22/09/2015 5:49 pm

error: Object
code: 2500
message: "Syntax error "Field 1 specified more than once. This is only possible before version 2.1" at character 3: 1,1,1,1"
type: "OAuthException"

โค้ด: เลือกทั้งหมด

  function Login_hompage() {
                console.log('Welcome!  Fetching your information.... ');
                FB.api('/me?fields={REGISTER_EMAIL}', function (response) {
                
                
                     });
        }


ข้างบน