Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8832631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:34:41+00:00 2026-06-14T08:34:41+00:00

ok so im making a file system viewer. Im stuck on this though, I

  • 0

ok so im making a file system viewer.
Im stuck on this though, I have everything working fine except when the I click the back button on the gui I have made.

So I have a string like so

http://www.grubber.co.nz/update/index.php?dir=../developer/_social_development

The script will go to the folder /developer/_social_development

but when I want to go back I press the back button and it will go back to the top directory so it goes all the way back to the first ‘/’ for example http://www.grubber.co.nz/update/index.php?dir=../
I use this code to get back to the last page which doesn’t work

$dir = $_GET['dir'];
$marker = "/";
echo $str = (substr($dir, 0, (strpos($dir, $marker) + strlen($marker)))); 

all it does is remove everthing to the first ‘/’ but I want it to goto the last ‘/’ for example it was this /developer/_social_development and when I click on the previous folder i want it to be /developer also the string will change depending on what folder you are in so I cant just remove a set amount of characters

Thanks for the help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:34:43+00:00Added an answer on June 14, 2026 at 8:34 am

    Using another method str pos, you may use explode. here complete code:

    $dir = '../developer/_social_development';
    $marker = "/";
    $arrDir = explode('/', $dir);
    array_pop($arrDir);
    $dir2 = implode( '/', $arrDir);
    echo $dir2;
    

    result: ../developer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am making a app which takes photo on button click i have camera.java
How can I resolve this problem ?why image file making system.dbnull error? private void
I'm making a php file that will run an event after five minutes have
Iam making an app which has one index.php file. I also have these other
We use MVC controllers that access System.File.IO in our application and they work fine
I'm making a document-based application, backed by an abstract file storage system. Sometimes the
I'm currently writing a procedure, I have a file system set out in syBase
I have a file system path in a NSString, but I need an FSRef
Working on a project for caching. Would like to do it with file system
I'm working on a big system, which I have written entirely in Java. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.