0

I have a PHP translation tool that sets $_Session['language'] as en, it, es, fr, or de.

Later in the site we have a flash product configurator that reads an XML file (cfg_feed_en.xml, cfg_feed_it.xml, cfg_feed_fr.xml, cfg_feed_es.xml, cfg_feed_de.xml) so that the language inside the flash tool matches the actual site language.

So my javascript call for the flashvars and params looks as follows:

var flashvars = {
  name: "product=level&xml_file=cfg_feed_<? echo $language; ?>.xml"

var params = {
  allowScriptAccess: "sameDomain", 
  quality: "high",
  bgcolor: "#000000",
  flashvars: "product=level&xml_file=<? echo $language; ?>.xml"  

It works perfectly locally on wamp but when I upload to the test server it fails.

var flashvars = {
  name: "product=level&xml_file=cfg_feed_.xml"

var params = {
  allowScriptAccess: "sameDomain", 
  quality: "high",
  bgcolor: "#000000",
  flashvars: "product=level&xml_file=.xml"

As per PHP session echo not working? I checked in FireCookie and verified that PHPSESSID is being generated both locally and on the server and in fact the translation tool is working fine.

So what is it that I don't know here?

Is it a server configuration issue? Do I need to go about this in another way?

Thanks.

1
  • Where is $language being set? You start talking about $_SESSION['language'], but your code contains $language. Commented Nov 14, 2010 at 14:43

1 Answer 1

3

If seems you have global variables enabled on your local server, this is a bad idea (search google for why).

You should be using <?php echo $_SESSION['language']; ?> to print out the language session variable.

Sign up to request clarification or add additional context in comments.

2 Comments

Yep, that's the problem. Didn't think anyone still had register_globals enabled like that.
Thanks Nathan...that was it :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.