0

イライラしている。

ControllerメソッドからMethodに変数を渡していますが、転送中に変更されています。もともとはばかげて呼ばれていたので、いろいろ$idな干渉が起こっているのではないかと思いましたが、名前を変えても問題は解決しません。

誰かが何が起こっているのか教えてもらえますか?

ここにコードがあります..私のコメントを確認してください

public function firstFbLogin()
{
    ChromePhp::log('AJAX - first FB login');  // logs fine
    $username          = $this->input->post('username');
    $first_name        = $this->input->post('first_name');
    $last_name         = $this->input->post('last_name');
    $facebookId        = $this->input->post('facebookId');
    $email             = $this->input->post('email');
    $third_party_id    = $this->input->post('third_party_id');
    $gender         = $this->input->post('gender');
    $this->Member_model->mFirstFbLogin($username, $first_name, $last_name, $email, $facebookId, $third_party_id, $gender);
            // here comes the issue..
    $idFromFbDooDaDay = $this->Member_model->mFetchIdFromFacebook($facebookId);
    ChromePhp::log("Id found and going out of ajax - firstFbLogin is ". $idFromFbDooDaDay); // <<< this logs 232 which is what I am expecting
    $this->Member_model->mCreateProfilePage($username, $first_name, $last_name, $idFromFbDooDaDay, $third_party_id, $gender);
    echo "TRUE";
}

しかし、その後、Member_modelにこれがあります(たくさん編集します)

    public function mCreateProfilePage($username, $first_name, $last_name, $gender, $idFromFbDooDaDay, $third_party_id)
    {
        // lets create a 'profile.html' used for FB object interaction
        $this->load->helper('file');
        ChromePhp::log('Id coming into mCreateProfilePage is ' . $idFromFbDooDaDay);  // this logs as D0k9f7LxtjIHMhGnbn6UkhDk3ao  WTF!?!
        $data = "<html>\n";
        $data .= "<head prefix=\"og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# profile: http://ogp.me/ns/profile#\">\n";
        $data .= "<meta property=\"fb:app_id\" content=\"32xxxxxxxxxxxx6\" />\n"; // my APP ID
        $data .= "<meta property=\"og:type\"   content=\"profile\" />\n";  // stays profile
        $data .= "<meta property=\"og:url\"    content=\"www.MYSITE.com/profiles/id-".$idFromFbDooDaDay."\" />\n"; // put the URL
        $data .= "<meta property=\"og:image\"  content=\"https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png\" />\n";  // url to bigPic

 ... edit ...

        $file_path = 'profiles/id-' . $idFromFbDooDaDay . '.html';

        if (!write_file($file_path, $data))
        {
             ChromePhp::log('Problem writing profile');
        }
        else
        {
             ChromePhp::log('Profile written to '. $file_path);
        }
    }

では、それはどのようにして、コントローラーからモデルへの単純なパスのスパンで$idFromFbDooDaDay = 23227文字の悪夢に変わっているのでしょうか。$idFromFbDOoDaDay = D0k9f7LxtjIHMhGnbn6UkhDk3ao

それは可変干渉であってはなりません..そして私が見る限り、他に何も変数に触れていません。何が起こってる?

4

1 に答える 1

5
// $this->Member_model->
mCreateProfilePage($username, $first_name, $last_name, $idFromFbDooDaDay, $third_party_id, $gender);
// public function 
mCreateProfilePage($username, $first_name, $last_name, $gender, $idFromFbDooDaDay, $third_party_id)

あなたの引数が一致していません。それが理由かもしれません:)

于 2013-01-22T15:12:41.710 に答える