Welcome Guest, Not a member yet? Register   Sign In
[Solved] Isset question
#1

(This post was last modified: 04-11-2015, 09:14 AM by wolfgang1983.)

I will try to explain it better.

I have been working on my directory paths. Which now have got working. $this->uri->segment(4) gets the directory name.

In my code below I need to be able to get the previous folders name in the elseif() but don't know how or if there is a better way.

I looked into str_replace(array('../', '..\\', '..'), '', $this->uri->segment(4)), '/'); but did not work.

PHP Code:
// Get's the name of the directory.
$foldername $this->uri->segment(4);

if (isset(
$foldername)) {

// first sub level

$directory FCPATH 'image/catalog' .'/'$foldername '/'// Working

} elseif ($foldername) { // Is finds if folder down level

// How can I get previous folder name
$directory FCPATH 'image/catalog/' .'/'$previousfolder .'/'$foldername '/';

}

} else {

$directory FCPATH 'image/' 'catalog/'// Working


Any suggestions.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#2

have you tried

Code:
$previous = $this->uri->segment(3);
Reply
#3

(04-11-2015, 04:42 AM)tildemark Wrote: have you tried


Code:
$previous = $this->uri->segment(3);

Thanks I had to set it in my main index and then echo to my json code then able to grab it for my upload function. I should of thought of that I think i had another brain fart Confused
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB