# PHP / SWF Object not working

**URL:** https://forum.kirupa.com/t/php-swf-object-not-working/269972
**Category:** Uncategorized
**Created:** [September 3, 2008, 6:20pm UTC](https://forum.kirupa.com/t/php-swf-object-not-working/269972 "2008-09-03T18:20:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dewey](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dewey](https://forum.kirupa.com/u/dewey)
#### Post date: [September 3, 2008, 6:20pm UTC](https://forum.kirupa.com/t/php-swf-object-not-working/269972/1 "2008-09-03T18:20:19Z")

</div>

Hey everyone… new to SWFObject 2.0 and I’m having some issues… I have an index.php that looks like…

```php
<?php
    require_once("services/draw.php");
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>player</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="js/swfobject.js"></script>
</head>
<body bgcolor="#ffffff">

<?php
    draw();
?>

</body>
</html>

```

The big part of my draw function is this… (just output swf object code…)

```php
echo " <div id=\"cPlayer\">
";
        echo " <a href=\"http://www.adobe.com/go/getflashplayer\">
";
        echo " <img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" />
";
        echo " </a>
";
        echo " </div>

";
            
        echo " <script type=\"text/javascript\">
";
        echo " var flashvars =
";
        echo " {
";
        echo " configUrl: $configUrl,
";
        echo " langCode: $langCode,
";
        echo " languageUrl: $languageUrl,
";
        echo " cid: $cid
";
        echo " };
";
        echo " var params = 
";
        echo " {
";
        echo " menu: \"false\"
";
        echo " };
";
        echo " var attributes = 
";
        echo " {
";
        echo " id: \"player\",
";
        echo " name: \"player\"
";
        echo " };
";
        echo " attributes.id = \"player\";
";
        echo " swfobject.embedSWF(\"swf/player.swf\", \"cPlayer\", \"650\", \"480\", \"9.0.0\", false, flashvars, params, attributes);
";
        echo " </script>
";

```

(setting of variables omitted)

I know the swf object code works because I just threw it into an HTML and it was fine, but when I build it like so I just get the image and link to download flash player…

Does anyone know how I can fix this?

Thank you,

–d
