Use yii session value on a plain script

Hi!, I have a problem with a script.

I hava a uploadify script in php, who upload the file and move to selected folder.

The selected folder is in a yii session variable: $folder=Yii::app()->user->folder;

I need to read this variable inside the script. In this script the yii engine not works because is outside /protected folder. I can’t read with Yii::app()->user->folder;

Any ideas??

Thanks!

More info:

Now I get the variable folder trought the uploadify javascript, like:

(…)

‘scriptData’: {‘folder’ : ‘/folder/selected’},

(…)

This works fine. But when this script is loaded, I dont’k know hoy change this value via javascript. For example when select a client in a combobox inside the page.

Maybe


var myfile='/folder/selected';

(..)

'scriptData': {'folder' : myfile},

(..) 

and change myfile at onchange of combobox

Thanks!

Now I have:


<script type="text/javascript">var myfile='32';</script>


<?php 		

echo CHtml::dropDownList('cliente','',CHtml::listData(Clientes::model()->findAll(),'id_cliente','nombre'),

                        array(

                           'empty'=>'- Selecciona un cliente -',                            	

                           'onchange'=>'myfile=31',                            	                    	                              

                        ));

?>

but there is something wrong because myfile don’t change…

[b]EDIT: the event onchange works. Myfile change, but the uplodify script don’t refresh the value:

‘scriptData’: {‘num’ : myfile},

only reads the initial value…[/b]

Is a problem of uploadify, he doesn’t accept js variable.

If you need to change the data, use uploadifySettings.

thank you!! it works perfectly.

Yeah!!!