Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default Pulling something out of a filename...

    Say I have this directory... /avatars/

    and there is no file in there but my php file which displays that persons avatar...

    I need to be able to pull this out of the url:

    http://www.sitename.com/avatars/username.gif

    I need to pull username out of the url.. using that PHP file.. thats the only thing in the directory.. it takes and pulls the username.. querys the database for that user. And displays it from /images/

    Any ideas on how to do that?

  2. #2
    Join Date
    May 2006
    Location
    Huntingdon (Cambridgeshire UK)
    Posts
    3,395
    Tokens
    0

    Latest Awards:

    Default

    Isnt that just simple variables ?

  3. #3
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Not sure.. but but its not a $_GET i don't think as your not going to bla.php?name=hey your going to /name.gif

  4. #4
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    if you just get the filename.. such as me.gif
    then use:
    PHP Code:
    $name basename("me.gif"); 
    that should remove the .gif I think..

  5. #5
    Join Date
    Jul 2005
    Posts
    1,653
    Tokens
    50

    Latest Awards:

    Default

    well just do something like this then ..
    $profile[name].gif

  6. #6
    Join Date
    May 2006
    Location
    Huntingdon (Cambridgeshire UK)
    Posts
    3,395
    Tokens
    0

    Latest Awards:

    Default

    Yeah that would be good. Set the variable to name and use

    $profile[name].gif

  7. #7
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    there is no gif file.. I just need to pull the info out of the url

  8. #8
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    there is no gif file.. I just need to pull the info out of the url
    So you want a PHP script which obtains a variable containing what's after the forward slash?
    kinda quit.

  9. #9
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Yes.. I have say

    www.site.com/images/Kevin.gif (My avatar)

    I need to have my PHP script pull 1 out of this:
    http://www.site.com/avatar/1.gif (1 = MY ID)

  10. #10
    Join Date
    Mar 2006
    Location
    Scotland
    Posts
    1,012
    Tokens
    175

    Latest Awards:

    Default

    Im not 100% sure what you mean. But wouldn't it be

    www.sitename.com/?view=/$profile[image]

    As the link so that you could get a profile image for that person

    The link would then be

    <a href=\"/$profile[image]\">Link</a>

    Im not 100% sure if this is helpful at all.


    You don't like me
    Chances are I don't like you.

Page 1 of 3 123 LastLast

Posting Permissions

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