I would like to change the location that a files uploads to by adding a PHP variable to the path name but I am unable to get it to work but I'm pretty sure it's a syntax error.
This doesn't work:
$this->options = array(
'script_url' => $this->get_full_url().'/',
'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/'.$user.'/',
'upload_url' => $this->get_full_url().'/'.$user.'/',
'param_name' => 'files'
)
This does:
$this->options = array(
'script_url' => $this->get_full_url().'/',
'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/bob/',
'upload_url' => $this->get_full_url().'/bob/',
'param_name' => 'files'
)
I realize that this is not the full code, but I wondered whether there is a simple syntax error I am missing here.
$user? What is it?);... what comes above this code? That's probably where the syntax problem lies, but the parser doesn't find it until later on.error_reporting(E_ALL); ini_set('display_errors', TRUE);because obviously there is some kind of error there that is not show to you and you need to read the error message and start searching based on that.