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 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default [PHP TUT] Explode and showing paths.

    Today I'm going to show you about how to explode a path, eg example.com/dir/extra/link/etc.php becomes Dir Extra Link Etc. Essentially making it easy to build on to become Dir --> Extra --> Link --> Etc. Etc
    Heres the code:
    PHP Code:
    <?php
    $path 
    $_SERVER['PHP_SELF']; // returns /home/attack/kill/etc.php

    $valuesArray explode("/",$path); // exploding the path

    /* returns:
     $valuesArray[0] = ""
     $valuesArray[1] = "home"
     $valuesArray[2] = "attack"
     $valuesArray[3] = "kill"
     $valuesArray[4] = "etc.php" // arrays
    */

    foreach ($valuesArray as $value){

      
    $name explode(".",$value); // exploding again
      
    echo $name[0]; // echoing the path part w/o

       
    if($name[1] == ""){ 
       echo 
    " &nbsp; &gt; &nbsp;"// checking the path.
       
    }
    }

    ?>
    Enjoy!
    How could this hapen to meeeeeeeeeeeeeee?lol.

  2. #2
    Join Date
    Jan 2007
    Location
    Canada eh?
    Posts
    766
    Tokens
    75

    Default

    Nice tutorial, although some real-life uses for it may have also helped - but overall good work. +Rep

  3. #3
    Join Date
    Feb 2008
    Location
    North Carolina, USA.
    Posts
    172
    Tokens
    0

    Default

    Either I am too tired to spot it, or something (been working for the past 20 hours)

    You forgot to upper case the directory

  4. #4
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Real life uses!?!???!

    Hmm:
    Habbox UK Forum > Technology + The Web > Designing & Development [PHP TUT] Explode and showing paths.
    enough said? obviously harder to do using url vars but ya know.
    Last edited by Hypertext; 11-02-2008 at 05:15 AM.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  5. #5
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Real life uses!?!???!

    Hmm:
    Habbox UK Forum > Technology + The Web > Designing & Development [PHP TUT] Explode and showing paths.
    enough said? obviously harder to do using url vars but ya know.
    Dude, that doesn't use explode to parse variables...

    The information is grabbed from an SQL Database which has no relevance to what you posted..

  6. #6
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Ye, like a MyBB board adds to the breadcrumb what ever it is. You dont see the link of this forum as

    http://www.habboxforum.com/Habbox UK Forum/Technology + The Web/Designing & Development/[PHP TUT] Explode and showing paths/

    Do you?

  7. #7
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    What exactly does it do?

  8. #8
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by --ss-- View Post
    What exactly does it do?
    I don't know but something completely ******ed by the looks of it.

    That would end up not showing file extensions which are pretty useful to have :rolleyes:


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  9. #9
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    And if you have a directory, e.g suspended.page/ then it wouldn't show .page

  10. #10
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Yeh its basically showing a nicer looking path. Umm. Yeh I was wrong about the Path but some people do use it, and it can be used sometimes.
    How could this hapen to meeeeeeeeeeeeeee?lol.

Page 1 of 2 12 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
  •