Generating dynamic object/emded tags
From Director Online Wiki
Here's a method of generating dynamic object/embed tags from name value pairs (POST or GET):
http://www.someplace.com/some.php?sw1=hello&sw2=world
This:
<?php echo_msie_params(); ?>
...will output:
<param name="sw1" value=hello>
<param name="sw2" value=world>
While this:
<?php echo_netscape_params(); ?>
...will output:
sw1=hello
sw2=world
Just include the following functions in your php:
<?php
function echo_msie_params() {
global $HTTP_POST_VARS, $HTTP_GET_VARS;
if ($_SERVER["REQUEST_METHOD"]=='GET') @$http_vars = $HTTP_GET_VARS;
else @$http_vars = $HTTP_POST_VARS;
foreach (array_keys($http_vars) as $key) {
$val = stripslashes($http_vars[$key]);
echo "\t<param name=\"$key\" value=$val>\n";
}
}
function echo_netscape_params() {
global $HTTP_POST_VARS, $HTTP_GET_VARS;
if ($_SERVER["REQUEST_METHOD"]=='GET') @$http_vars = $HTTP_GET_VARS;
else @$http_vars = $HTTP_POST_VARS;
foreach (array_keys($http_vars) as $key) {
$val = stripslashes($http_vars[$key]);
echo "\t$key=$val\n";
}
}
?>
--[[User:Cole|CBT]] 13:15, 12 Oct 2005 (MDT)