SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    Jul 2006
    Location
    New Zealand
    Posts
    1,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    facebook app displaying username in a textbox

    Hi all,

    I am currently developing an application for my face book and for some reason i get the weird thing in and around my textbox you can see what i mean looking at



    See where the textbox that has fb name in it then next to it is "/> how can i get rid of that and get the name of the user appear in the textbox?

    This is my code for my username being dispalyed.

    PHP Code:
    <input type="text" name="fuser" value="<?php echo $F_user;?>"><?php
    and the code of $F_user is

    PHP Code:
    $F_user='<fb:name uid="$fb_users" useyou="false" firstnameonly="true" linked="false"/>'
    So what is causing this problem?

    Can anyone help me with this?

    Thanks,William

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you echo it on the page without the text box? It could be that Facebook only renders it when its an actual element instead of a value.


  3. #3
    SitePoint Wizard
    Join Date
    Jul 2006
    Location
    New Zealand
    Posts
    1,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea i did that by going echo $f_user; but that works not sure do you think it has somthing to do with the faceboook framework? i could turn $f_user into a global variable it could fix my issue but why doesnt facebook like what i have done?

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whether you store it in a php variable or not, it's not actually PHP that renders the document. The facebook code does a global find and replace on your page.

    If you simply put

    Code facebook:

    on a page outside of any other html element, i.e. in a P tag. What does it display? A text box, the actual user's name or something else?

    It's likely that facebook's code checks to see if the above code is within an element or not and decides whether or not to render it.


  5. #5
    SitePoint Wizard
    Join Date
    Jul 2006
    Location
    New Zealand
    Posts
    1,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The users actual name because it has worked b4 so not sure why when i echo the variable it shud shudnt it?

  6. #6
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the variable simply holds the text '<fb:name ' so it wouldn't make any difference.

    When facebook reads your page, it has rendered the php already. then facebook parses your <fb code afterwards.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •