I am fairly new to the image functions used within PHP and I recently got a simple script which creates a .png image of a bar graph showing values and I manipulated it slightly so it reads values from the MySQL database. Now it uses imagepng() but I am not sure how I can save the file on the remote disk or if it is even possible?.
Fullest Regards
Joe
[SOLVED] bar graph
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
remote disk, being on the server, or on the client?
on the server, you can pass the filename parameter of the [php_man]imagepng()[/php_man] function.
If you want to save it on the client, there's allowing them to choose to save it.. and forcing the save dialog box to display. For forcing the download, read the [php_man]header()[/php_man] documentation. For display, you'll need a header call to tell the client you are sending it an png image.
on the server, you can pass the filename parameter of the [php_man]imagepng()[/php_man] function.
If you want to save it on the client, there's allowing them to choose to save it.. and forcing the save dialog box to display. For forcing the download, read the [php_man]header()[/php_man] documentation. For display, you'll need a header call to tell the client you are sending it an png image.
Code: Select all
$image = imagecreatefrompng("test.png");
imagepng($image);