Ah. Clever.
What they're doing is just displaying an image from their server. For example, imagine you have an HTML page with an image in it called "http://www.domain.com/upgrade.jpg" ... that just displays the image from domain.com. Using PHP you can dynamically generate an image (with GD). So if you set php properly you can call something like upgrade.jpg?version=123, and build an image based on that. Obviously you'd make a "you need to upgrade" image if the latest version was lower than the version passed in the GET request.
Essentially it completely bypasses PHP. It's just done in the browser. That's a very sensible approach really because it doesn't rely on URL wrappers or external calls of any sort being available on the server.
check if app's "up-to-date"
Moderator: General Moderators
Thanks for that bit of info.
I have looked up GD and used the following code:
Unfortunately this requires that i have the fopen wrappers on also. All i receive is a timeout for about 3-5 minutes then the "Error loading" message. It only works if i call for the image locally. Anyways, is this what you meant in the post above?
I have looked up GD and used the following code:
Code: Select all
<?php
function LoadPNG($imgname)
{
$im = @imagecreatefrompng($imgname); /* Attempt to open */
if (!$im) { /* See if it failed */
$im = imagecreatetruecolor(150, 30); /* Create a blank image */
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
/* Output an errmsg */
imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
}
return $im;
}
header("Content-Type: image/png");
$img = LoadPNG("http://mydomain.com/upgrade.png");
imagepng($img);
?>