Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 11-02-2008, 12:08 AM PHP image
Super Talker

Posts: 102
Trades: 0
Is there any easier way to get pretty much the same result?
http://zyberscape.com/aaronsgetotest.php
PHP Code:
<?
// checks if the server is online or offline
$i "255.255.255.255";
$p "6000";
$c = @fsockopen($i$p$ERRNO$ERRSTR1);

// create a 741*17 image
$online imagecreate(74117);
$offline imagecreate(74117);

// text variables
$bg imagecolorallocate($im000);
$textcolor imagecolorallocate($im01600);

$bg2 imagecolorallocate($im2000);
$textcolor2 imagecolorallocate($im2255400);

imagestring($online500" On"  $textcolor);
imagestring($offline500" Off"  $textcolor2);

// output the image
header("Content-type: image/png");
    if(
$c) {
        echo 
imagepng($online);
    }
    else {
        echo 
imagepng($offline);
    }
?>
Aaron™ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-02-2008, 08:27 PM Re: PHP image
Skilled Talker

Posts: 52
Name: Morten
Trades: 0
There is always a way, but the code is nice and decent, why do you want it to be any smaller?
__________________
- Do Nothing!
- Get Nothing!

Please login or register to view this content. Registration is FREE
Rotco88 is offline
Reply With Quote
View Public Profile
 
Old 11-03-2008, 10:19 AM Re: PHP image
Super Talker

Posts: 102
Trades: 0
Becuase I am new with PHP Images and it looks really ugly to me.
Aaron™ is offline
Reply With Quote
View Public Profile
 
Old 11-03-2008, 10:30 AM Re: PHP image
Experienced Talker

Posts: 46
Name: John Henson
Trades: 0
But why would you want to use an image with text on to output text?

Surely you could style a div with CSS to contain the text message.
Invictus is offline
Reply With Quote
View Public Profile
 
Old 11-03-2008, 02:30 PM Re: PHP image
Super Talker

Posts: 102
Trades: 0
Not really because I want to use it on forums and ext. so I have to keep it without CSS/HTML so I place it as an [Img]
Aaron™ is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP image
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44076 seconds with 12 queries