SQL PHP HTML ASP JavaScript articles and free scripts to download
 
 

Header defined for an image to browser


When we are drawing images on the fly we have to tell the browser about the content we are sending to it. We can't display an image by telling the browser that we are sending text or html code. To this we have to use header declaration at the first line of data we send to the browser window.

header("Content-type: image/jpg");



Without this line at the starting of the data (not the starting of the page) if we send and image browser will display non recognized characters on the screen. So we have to tell browser that we are sending an image. We also can't send any text or data along with the image. So we will be using another window to display any graph or image not the existing window were some text or data is already there. We also can't mix both in the new window.

By default browser is set to display text only.


Further readings
GD functions in PHP for handling images & graphs
How to check GD support in PHP
Header for an image in browser
Drawing of graphic lines using GD
Plotting line graph by drawing data from table
Adding vertical grid to line graph
Resizing and adding border to Images
Script for Watermarking image on the fly using PHP GD










Sections
PHP
JavaScript
ASP
HTML
SQL
Photoshop
Articles SEO
PHP Tutorials
Array Functions
PHP Monthly Planner
PHP Introduction
Loops & structure
Array
Date & Time
Functions
Form Handling
File Handling
Math Functions
String Functions
GD Functions
Comment Posting
Content Management
PHP & Ajax
Popular Tutorials
Drop down list
File Upload
Signup script
Member Login
Line Graph
PHP MySQL Paging
PHP Calendar
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.