1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[Facebook] Function Problems!

Discussion in 'Programming' started by ricdes, Feb 14, 2008.

  1. #1
    Hi guys,

    I just started coding my app yesterday but I hope you can help me out.

    I dont know why it keeps giving me out these error when I execute this code:

    $facebook->api_client->profile_setFBML("text", $user);
    $facebook->redirect($facebook->get_facebook_url() . '/profile.php');

    Thats the error msg:

    Fatal error: Call to a member function profile_setFBML() on a non-object in /home/.user/index.php

    Both functions give out errors which I think are mentioning that I am trying to use a function, that doesnt exist. But why doesnt it exist? I have included the appinclude.php and the facebook.php is included there also. Both seem to be included correctly too.

    I am out of answers and the forum doesnt help me out a lot on that too,

    any hints please? smile

    Thanks!
     
    ricdes, Feb 14, 2008 IP
  2. Andy Peters

    Andy Peters Peon

    Messages:
    430
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $string = "PHP String"; 
     $fbml = <<<EndHereDoc
      TEXT<Br>
    $string
    EndHereDoc;
    
    $facebook->api_client->profile_setFBML($fbml, $user);
    $facebook->redirect($facebook->get_facebook_url() . '/profile.php');
    
    PHP:
    You can't run PHP code within the endheredoc, but it will echo strings.
     
    Andy Peters, Feb 14, 2008 IP
  3. MOG

    MOG Well-Known Member

    Messages:
    2,219
    Likes Received:
    163
    Best Answers:
    0
    Trophy Points:
    180
    #3
    are you also including the facebook php libraries, and are you using the correct php version?
     
    MOG, Feb 14, 2008 IP
  4. ricdes

    ricdes Peon

    Messages:
    366
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yeah, im using the correct php version and it includes the libraries (tested it by making an echo in the facebook.php file)

    [quote andy]
    im not running any php commands there.. I dont know what this is happening :(
    [/quote]
     
    ricdes, Feb 14, 2008 IP
  5. Andy Peters

    Andy Peters Peon

    Messages:
    430
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Andy Peters, Feb 14, 2008 IP