开发者

PHP Echo works locally, does not work on testing server

I have a PHP translation tool tha开发者_如何学Pythont 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜