Hi guys'n'gals, I posted about this before, but it was mixed in with some other stuff and kind of got lost...
I'm trying to set the baseURL from outside of config.php, because there are a number of different folders I want to be able to access with it.
I've got this code in my php file that calls in ckfinder:
this generates a session variable like '/images/galleries/test/'.
then in my config.php file I've got the following:
It al works fine when the session variable isn't set, but when it is I get access to the entire site, which isn't so great.
Can anyone see what I'm doing wrong?
EDIT - figured it. I think I had somehow broken something somewhere else, and the following , slightly simplified, code worked fine for me:
in the php page which calls ckfinder:
and in config.php:
I'm trying to set the baseURL from outside of config.php, because there are a number of different folders I want to be able to access with it.
I've got this code in my php file that calls in ckfinder:
if (isset($_GET['folder'])){$_SESSION['ckfolder'] = '/images/galleries/'.$_GET['folder'].'/';} else{unset($_SESSION['ckfolder']);}
this generates a session variable like '/images/galleries/test/'.
then in my config.php file I've got the following:
if (isset($_SESSION['ckfolder'])){ $baseURL = $_SESSION['ckfolder']; }else{ $baseUrl = '/images/uploads/';}
It al works fine when the session variable isn't set, but when it is I get access to the entire site, which isn't so great.
Can anyone see what I'm doing wrong?
EDIT - figured it. I think I had somehow broken something somewhere else, and the following , slightly simplified, code worked fine for me:
in the php page which calls ckfinder:
$_SESSION['foldername'] = $_POST['foldername'];
and in config.php:
$baseUrl = '/images/galleries/'.$_SESSION['ckfolder'];Obviously with 'session_start();' at the top of both files. SO now if anyone else comes looking, hopefully you know how to do it!