1- Problem is that I can't access the variable from config.php
well, this code should work var move= <?php echo '"'.$config['root'].'"';?>
Please notice that an URL is a string. You can not write something as
var string = some text
instead, you should add quotation marks at the beginning and end of the string.
var string = "some text"
I just don't know what you mean with the first 2 quotation marks in ""+move+"sf/" ;
Did you hide the domain? If so, I suggest you to add this part of the URL in the config.php as well.
3- I want that I only change at one point and dont have to make changes at all code.
But the point is config.php, right? You just have to change the variables in config.php and make sure all the other .PHP files include it.
have a look at the php.ini option called auto_prepend_file to automatically add PHP code to all PHP scripts.
http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file
you have to provide a local path (/usr/local/... or c:/server/...)