$value) {
if($field != ‘setwidth’ && $field != ‘setheight’) {
$query_string .= urlencode($field) . ‘=’ . urlencode($value) . ‘&’;
}
}
$query_string = substr($query_string, 0, -1);
$path_info = pathinfo($_SERVER[‘SCRIPT_NAME’]);
$image_content = file_get_contents(‘http://’ . $_SERVER[‘SERVER_NAME’] . htmlentities($path_info[‘dirname’]) . ‘/’ . $query_string);
if($image = imagecreatefromstring($image_content)) {
echo ‘
‘;
} else {
echo ‘
Sorry, the following error occurred: ‘ . $image_content . ‘
‘;
}
echo ‘
Width: ' . imagesx($image) . ' Height: ' . imagesy($image) . '
Please right-click to save the image to your computer.
‘;
}
?>