PDA

View Full Version : PHP/CSS?



Johno
09-07-2008, 07:58 PM
Hey,
In my website at the moment I have a little problem, with some CSS/PHP.
Now the layout is practically ready, but we have an image of the habbo that we want to replace with the users habbo.

Now this is defined in our CSS file as:

#main #users #habbo {
margin-top: 0px;
margin-left: 36px;
height: 90px;
width: 86px;
background: url(Image URL) no-repeat bottom center;
float: left;
}

Now, the URL of the habbo image is:
http://www.habbo.co.uk/habbo-imaging/avatarimage?user=HABBONAME&action=&direction=3&head_direction=3&gesture=sml&size=l
(Switching HABBONAME with the users habbo name)

The habbo name of the user is defined as $logged[habboname] but I cannot seem to figure out how to make all this come together.

Any help is appreciated! :)
(Ill give +REP if I can too)

Protege
09-07-2008, 08:05 PM
Hey,
In my website at the moment I have a little problem, with some CSS/PHP.
Now the layout is practically ready, but we have an image of the habbo that we want to replace with the users habbo.

Now this is defined in our CSS file as:

#main #users #habbo {
margin-top: 0px;
margin-left: 36px;
height: 90px;
width: 86px;
background: url(Image URL) no-repeat bottom center;
float: left;
}

Now, the URL of the habbo image is:
http://www.habbo.co.uk/habbo-imaging/avatarimage?user=HABBONAME&action=&direction=3&head_direction=3&gesture=sml&size=l
(Switching HABBONAME with the users habbo name)

The habbo name of the user is defined as $logged[habboname] but I cannot seem to figure out how to make all this come together.

Any help is appreciated! :)
(Ill give +REP if I can too)


<?php
$url = 'http://www.habbo.co.uk/habbo-imaging/avatarimage?user=' . $logged[ 'habboname' ] . '&action=&direction=3&head_direction=3&gesture=sml&size=l';
echo ( '<style type="text/css">
#main #users #habbo {
margin-top: 0px;
margin-left: 36px;
height: 90px;
width: 86px;
background: url( "' . $url . ' " ) no-repeat bottom center;
float: left;
}
</style>' );
?>

Johno
09-07-2008, 08:15 PM
Thanks :)

Works perfectly! +REP

Want to hide these adverts? Register an account for free!