Long description

Back

The H T M L code shows one line of code. Line 1: open angle bracket img s r c equals open double quotes resize dot p h p question mark file equals 134020 ampersand width equals 300 ampersand overlay equals Hello close double quotes close angle bracket. An arrow labeled Notice this requests a p h p page and not an image file points from resize dot p h p to the p h p code named resize dot p h p. file equals 134020 ampersand width equals 300 ampersand overlay equals Hello is labeled query string customizes the image.

The P H P code consists of 17 lines of code at indentation level 0. Line 1: open angle bracket question mark p h p. Line 2: forward slash forward slash tell browser this is an image. Line 3: header open parenthesis open single quote Content hyphen Type colon image forward slash jpeg close single quote close parenthesis semicolon. Line 4: forward slash forward slash create the image from a file. Line 5: dollar i m g name equals open double quotes images forward slash art forward slash dollar underscore GET open square bracket open single quote file close single quote close square bracket dot j p g close double quotes semicolon. Line 6: dollar i m g equals imagecreatefromjpeg open parenthesis dollar imgname close parenthesis semicolon. Line 7: forward slash forward slash resize the image to requested size. Line 8: dollar w equals dollar underscore GET open square bracket open single quote width close single quote close square bracket semicolon. Line 9: dollar new i m g equals imagescale open parenthesis dollar i m g comma dollar w comma dollar w close parenthesis semicolon. Line 10: forward slash forward slash add some text to it. Line 11: dollar fontFile equals realpath open parenthesis open single quote font forward slash Lato hyphen Medium dot t t f close single quote close parenthesis semicolon. Line 12: dollar fontSize equals 16 semicolon. Line 13: dollar textColor equals imagecolorallocate open parenthesis dollar new i m g comma 238 comma 238 comma 238 close parenthesis semicolon. Line 14: imagettftext open parenthesis dollar newimg comma dollar fontSize comma 0 comma 250 comma 160 comma dollar textColor comma dollar fontFile comma dollar underscore GET open square bracket open single quote overlay close single quote close square bracket close parenthesis semicolon. Line 15: forward slash forward slash now return it to requesting browser. Line 16: imagejpeg open parenthesis dollar new i m g close parenthesis semicolon. Line 17: question mark close angle bracket.

An image with Hello text on it is placed at the right bottom of the figure.

An arrow labeled Notice this P H P page returns no markup dots but returns an image instead points from the P H P code block to the image.

Back