<?php
$source = file_get_contents([B]$clan_link[/B]);
$pattern = '/Record: ([0-9-]+).*?World Rank: ([0-9]+).*?Regional Rank: ([0-9]+)/s';
preg_match($pattern, $source, $matches);
list(, $record, $world_rank, $regional_rank) = $matches;
// load the image from the file specified:
$im = imagecreatefrompng("sig2.png");
// if there's an error, stop processing the page:
if(!$im)
{
die("");
}
// define some colours to use with the image
$yellow = imagecolorallocate($im, 255, 255, 0);
$black = imagecolorallocate($im, 0, 0, 0);
// get the width and the height of the image
$width = imagesx($im);
$height = imagesy($im);
// draw a black rectangle across the bottom, say, 20 pixels of the image:
// now we want to write in the centre of the rectangle:
$font = 2; // store the int ID of the system font we're using in $font
$text1 = $record; // store the text we're going to write in $text
// calculate the left position of the text:
$leftTextPos = ( $width - imagefontwidth($font)*strlen($text) )/3.5;
// finally, write the string:
imagestring($im, $font, $leftTextPos, $height-30, $text1, $yellow);
$font = 2; // store the int ID of the system font we're using in $font
$text2 = $world_rank; // store the text we're going to write in $text
// calculate the left position of the text:
$leftTextPos = ( $width - imagefontwidth($font)*strlen($text) )/1.7;
// finally, write the string:
imagestring($im, $font, $leftTextPos, $height-30, $text2, $yellow);
$font = 2; // store the int ID of the system font we're using in $font
$text3 = $regional_rank; // store the text we're going to write in $text
// calculate the left position of the text:
$leftTextPos = ( $width - imagefontwidth($font)*strlen($text3) )/1.1;
// finally, write the string:
imagestring($im, $font, $leftTextPos, $height-30, $text3, $yellow);
// output the image
// tell the browser what we're sending it
Header('Content-type: image/png');
// output the image as a png
imagepng($im);
// tidy up
imagedestroy($im);
?>
Which outputs like this
www.4f-scotland.com/stats/sig2.php
How can i make a form which then sets the variable of $clan_link and then makes a new image using the new variable and saves on my server.