Image Source to Include a PHP Input

121 Views Asked by At

I am trying to create an image that changes dependent on the genre grabbed from an icecast server, I am pretty sure I have the base code correct I think I've just incorrectly inputted the PHP variable.

<?php
            $stats = $core->radioInfo( "http://http://sc.onlyhabbo.net:8124/status-json.xsl" );
            ?>
<img src=http://www.habbo.com/habbo-imaging/avatarimage?user=<?php
                        echo $stats['genre'];
                    ?>&action=std&direction=2&head_direction=2&gesture=sml&size=m&img_format=gif/>

is the full code. Have I inputted the PHP variable incorrectly

2

There are 2 best solutions below

0
On BEST ANSWER

UPDATE EVERYBODY

This is now resolved, I decided to go down the CURL route for this, and at first it didn't work until my host raised our CloudLinux Process Limit. I am unsure what the actual issue with this code was, but the CURL route works fine. Thank you for any answers

1
On

Where are the quotes in your Html?

<img src="http://www.habbo.com/habbo-imaging/avatarimage?user=<?php
                    echo $stats['genre'];
                ?>&action=std&direction=2&head_direction=2&gesture=sml&size=m&img_format=gif"/>