# Loading a SWF into PHP via an XML file!

**URL:** https://forum.kirupa.com/t/loading-a-swf-into-php-via-an-xml-file/277807
**Category:** programming
**Created:** [December 17, 2008, 2:47pm UTC](https://forum.kirupa.com/t/loading-a-swf-into-php-via-an-xml-file/277807 "2008-12-17T14:47:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Christam1](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christam1](https://forum.kirupa.com/u/Christam1)
#### Post date: [December 17, 2008, 2:47pm UTC](https://forum.kirupa.com/t/loading-a-swf-into-php-via-an-xml-file/277807/1 "2008-12-17T14:47:05Z")

</div>

Hey there, I have a PHP file, an SWF and an XML which contains all the information to go into the PHP.

The XML is as follows:

```auto
<polls>
<poll title="Who do you think should win Pop Icons 2009?">
	<answers>
	<answer>
		<name>Michael</name>
		<tally>0</tally> <image>www.clipart.com/test1.jpg</image>
		<flash>songs/1.swf</flash>
	</answer>
	<answer>
		<name>George</name>
		<tally>0</tally> <image>www.clipart.com/test2.jpg</image>
		<flash>songs/2.swf</flash>
	</answer>

```

So far the PHP code has been working correctly to display a different name and image in each cell in a table. However, when I’ve tried to insert the code for flash I get nothing now! Here is what I have so far, can anybody see what could be wrong with just the flash part to make the whole thing stop working? Here is the PHP code I have including the non-working flash part on the last few lines…

```php
        for ($i = 0; $i < 4; $i++) {
			echo "<td>";		
            echo "<input type=\"radio\" name=\"vote\" value=\"" . $polls->poll[$pid]->answers->answer[$i]->name . "\" />" . $polls->poll[$pid]->answers->answer[$i]->name.	
                     (isset($polls->poll[$pid]->answers->answer[$i]->image)? 
                            '<br/><img src="' . $polls->poll[$pid]->answers->answer[$i]->image . '">'
                             :'').
							 
					(isset($polls->poll[$pid]->answers->answer[$i]->flash)?
					 		'<br/><object width="100" height="30">'
							'<br/><param name="movie" value="' 
							 . $polls->poll[$pid]->answers->answer[$i]->flash . '">'
							 '<br/><embed src="' . $polls->poll[$pid]->answers->answer[$i]->flash . '">'
							 '<br/></embed>'
							 '<br/></object>'
                         
                             :'').										 					 
							 
                      "
";
        }
    } 

```

I think I’m nearly there and it’s just a simple mistake but I can’t work it out!  
Thanks a lot 🙂  
Chris
