Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username="root";
- $password="maverick";
- $database="arduino";
- mysql_connect(localhost,$username,$password);
- @mysql_select_db($database) or die( "Unable to select database");
- $result = mysql_query("SELECT * FROM temp");
- $status = mysql_result($result, 1, temp);
- //$status = mysql_result($result, 0, "data");
- $data = $status; //explode("|", $status);
- $font = "aerial.ttf";
- $image = imagecreatefrompng("254.png");
- $font_size = 10;
- $color = imagecolorallocate($image, 255,255,255);
- $black = imagecolorallocate($image, 0,0,0);
- ImageTTFText ($image, $font_size, 0, 4, 12, $black, $font, "Temp: " . $data . "C");
- ImageTTFText ($image, $font_size, 0, 4, 12, $color, $font, "Temp: " . $data . "C");
- // ImageTTFText ($image, $font_size, 0, 110, 12, $black, $font, "Humidity: " . $data[2] . "%");
- // ImageTTFText ($image, $font_size, 0, 110, 12, $color, $font, "Humidity: " . $data[2] . "%");
- // ImageTTFText ($image, $font_size, 0, 242, 12, $black, $font, "Fan: " . $data[3] . "rpm");
- // ImageTTFText ($image, $font_size, 0, 242, 12, $color, $font, "Fan: " . $data[3] . "rpm");
- header("Content-type: image/png");
- imagepng($image);
- imagedestroy($image);
- ?>
Add Comment
Please, Sign In to add comment