FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

PHP imagecreate + CSS problem.

 


Diablosblizz
Now that I've moved from web to other coding languages, I've come across Vista's sidebar and how to make gadgets for them. I am having a problem though. I am making a apache + mysql pinger for my server, it's working well but I can't align the image to the top corner. See an example here:

http://clan-ik.frih.net/bserver/test.html

It's right in the top corner, no margin. I am having trouble doing that in PHP, and I am not quite sure if this is a PHP problem, or a CSS problem. Here's what I have so far:

Code:
<style>
body {
margin: 0;
}
</style>
<body>
<?php
$my_img = imagecreate( 199, 50 );
$background = imagecolorallocate( $my_img, 0, 0, 255 );
$text_colour = imagecolorallocate( $my_img, 255, 255, 0 );
$line_colour = imagecolorallocate( $my_img, 128, 255, 0 );
imagestring( $my_img, 4, 30, 25, "TEXT",
  $text_colour );
imagesetthickness ( $my_img, 5 );
imageline( $my_img, 30, 45, 165, 45, $line_colour );

header( "Content-type: image/png" );
imagepng( $my_img );
imagecolordeallocate( $line_color );
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $my_img );
?>
</body>


It just gives me some stupid header errors, and I know that you can't do it from CSS when you're creating an image with PHP, which leaves me in quite a problem here. Basically, I NEED this to be aligned right to the corner, else it will look off centered and will have a white background.

Does anybody have a work around for this? Or is there a way to set the margin before creating the image with PHP?

Thank you for your help.
Related topics

PHP imagecreate + CSS problem.
What do you use to make your page layout?
CSS problem...
PHP include code problem
PHP homepage recreation problem

Runaway CSS Header - Need to find a way to scale it
CSS Problem
Problem with PHP
Css problem
PHP Form Sending problem

Probably a minor CSS issue
Php while array problem
CSS problem in IE 6
PHP login script problem
Slight css problem in IE [SOLVED]
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.