Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to include a PHP generated XML file into flash vars, while ALSO passing through the current php functions into it?
    text
    copied!<p>Hello <strong>Given situation</strong>: In <code>webpage.php</code> the flashscript is calling a flash script with a flashvar: the playlist file which is a PHP generated XML file: <code>playlist.php</code>, it does that well so long as there are no extra functions in there. Now, in that <code>XML-format</code> playlistfile there needs to be a special function, besides the usual <code>echo("");</code>, namely the very special <code>echo __("");</code> function that is already declared in <code>webpage.php</code> which needs to do something with the paragraphs residing within that xml file.</p> <p><strong>However</strong>, currently the retrieved file misses the function <code>echo __();</code>and says <strong><em>"no such function declared in that xml-format [playlist.php] file"</em></strong>. The php functions that are currently included at the very top of <code>webpage.php</code> somehow do not pass-through-the necessary functions into the playlist file for it to recognise how to handle it, in order for that playlist to get those necessary functions working. </p> <p>Apparently these are not passed through automatically/properly when residing in the flashvars?? Cause the <code>echo __("");</code> works fine when called within <code>webpage.php</code> or via a normal php <code>include("");</code> if those functions are in a different php file. But not working from the <code>playlist.php</code> file.</p> <p>Any ideas why/what is going on here?<br> I appreciate your clues for this prob +1. Thanks very much.</p> <hr> <p><strong>WEBPAGE.PHP</strong> the webpage, has at the top an include with functions:</p> <pre><code>&lt;?php include (functions.php); ?&gt; // function that know what to do with echo __("paragraph") </code></pre> <p></p> <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt; run( 'play', 'true', 'loop', 'true', 'flashvars', 'xmlFile=/incl/playlist.php', // &lt;&lt;&lt;&lt; !! 'wmode', 'transparent', 'allowScriptAccess','sameDomain', ); &lt;/script&gt; &lt;noscript&gt; &lt;object classid="blabla"&gt; &lt;param name="allowScriptAccess" value="sameDomain" /&gt; &lt;param name="movie" value="/movies/movie.swf" /&gt; &lt;param name="flashvars" value="xmlFile=/incl/playlist.php" /&gt; // &lt;&lt;&lt; !! &lt;embed src="/movies/movies.swf" type="application/x-shockwave-flash"/&gt; &lt;/object&gt; &lt;/noscript&gt; </code></pre> <hr> <p><strong>PLAYLIST.PHP</strong> The PHP generated XML file which is retrieved into the webpage as flash variable (see above)</p> <pre><code>&lt;?php echo ('&lt;?xml version="1.0" encoding="UTF-8"?&gt;'); echo ('&lt;songs&gt;'); echo ('&lt;song version="1. "') . __("boom blue blow bell bowl") . ('/&gt;'); echo ('&lt;song version="2. "') . __("ball bail beam bike base") . ('/&gt;'); echo ('&lt;/songs&gt;'); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload