Php > Graphics
UK Postcode Map
UK Postcode Map 1); $results = mysql_fetch_array($result, MYSQL_ASSOC); return $results['post']; } $post = getpost($_GET['postcode']); $postcode = $post; $sql = "SELECT * FROM codes WHERE post='$postcode'"; $results = mysql_query($sql); $row = mysql_fetch_array($results); $latitude = $row[5]; $longitude = $row[6]; settype($latitude, "float"); settype($longitude, "float"); $longwidth = (10.40480+1.76791); // 12.17271 $latheight = (58.67925-49.97763);//8.70162 $canvaswidth = 381; $canvasheight = 440; $amountleft = (((10.40480+$longitude)/$longwidth)*$canvaswidth); $amountdown = ($canvasheight-(((($latitude-49.97763)/$latheight))*$canvasheight)); $amountleft = round($amountleft); $amountdown = round($amountdown); $image = imagecreatefrompng("croppedmap.png"); $red = imagecolorallocate($image, 255,0,0); imagefilledrectangle($image,$amountleft-2,$amountdown-2,$amountleft+2,$amountdown+2,$red); header ("Content-type: image/png"); imagepng($image); imagedestroy($image); ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage