i working imagecreate, here code:
<?php $my_img = imagecreate( 200, 80 ); $background = imagecolorallocate( $my_img, 0, 0, 255 ); $text_colour = imagecolorallocate( $my_img, 255, 255, 0 ); $line_colour = imagecolorallocate( $my_img, 128, 255, 0 ); imagestring( $my_img, 4, 30, 25, "santosh", $text_colour ); imagesetthickness ( $my_img, 5 ); imageline( $my_img, 30, 45, 165, 45, $line_colour ); header( "content-type: image/png" ); imagepng( $my_img ); imagecolordeallocate( $line_color ); imagecolordeallocate( $text_color ); imagecolordeallocate( $background ); imagedestroy( $my_img ); ?> well, dimensions passed imagecreate hardcoded don't want to. want dimensions taken url. know can use call _get so. make url like: script.php?h=100&w=200. want like: script.php/100/200.
so, how input url fragment?
you can strip out script name , explode parameters follows
$extra_path = str_replace($_server['script_name'],'',$_server['request_uri']); $parts = explode('/',$extra_path); this give you
$parts = array( '100', '200' );
Comments
Post a Comment