Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

create image on server using php

Avatar of winsoftech
winsoftech asked on
PHP
3 Comments1 Solution528 ViewsLast Modified:
Send the simple code for create jpeg image on server

iam creating jpeg image on localhost but that code do not run properly on the server
<?php
 
header ("Content-type: image/jpeg");
 
$graph=imagecreate(600,400);
$back_color= imagecolorallocate($graph,150,195,155);
$line_color= imagecolorallocate($graph,10,25,20);
$in_line_color= imagecolorallocate($graph,250,220,250);
$draw_line= imagecolorallocate($graph,140,110,210);
$overs= imagecolorallocate($graph,250,20,10);
$runs= imagecolorallocate($graph,100,110,00);
 
//--------------------horizontal--------------------------//
imageline($graph, 50, 0, 50, 350, $line_color);
 
imageline($graph, 100, 0, 100, 350, $in_line_color);
imageline($graph, 150, 0, 150, 350, $in_line_color);
imageline($graph, 200, 0, 200, 350, $in_line_color);
imageline($graph, 250, 0, 250, 350, $in_line_color);
imageline($graph, 300, 0, 300, 350, $in_line_color);
imageline($graph, 350, 0, 350, 350, $in_line_color);
imageline($graph, 400, 0, 400, 350, $in_line_color);
imageline($graph, 450, 0, 450, 350, $in_line_color);
imageline($graph, 500, 0, 500, 350, $in_line_color);
imageline($graph, 550, 0, 550, 350, $in_line_color);
 
 
imagestring($graph, 100, 100, 350, "hjfghjfhj1",$overs);
 
imagestring($graph, 150, 150, 350, "dsfga2",$overs);
imagestring($graph, 200, 200, 350, "3",$overs);
imagestring($graph, 250, 250, 350, "4",$overs);
imagestring($graph, 300, 300, 350, "sfdgsdf5",$overs);
imagestring($graph, 350, 350, 350, "6",$overs);
imagestring($graph, 400, 400, 350, "sfdasd7",$overs);
imagestring($graph, 450, 450, 350, "8",$overs);
imagestring($graph, 500, 500, 350, "9",$overs);
imagestring($graph, 550, 550, 350, "dafgasdf10",$overs);
 
//-------------------------vertical-------------------------//
 
imageline($graph, 50, 350, 600, 350, $line_color);
imageline($graph, 50, 300, 600, 300, $in_line_color);
imageline($graph, 50, 250, 600, 250, $in_line_color);
imageline($graph, 50, 200, 600, 200, $in_line_color);
imageline($graph, 50, 150, 600, 150, $in_line_color);
imageline($graph, 50, 100, 600, 100, $in_line_color);
imageline($graph, 50, 50, 600, 50, $in_line_color);
 
imagestring($graph, 30, 30, 40, "36",$runs);
imagestring($graph, 30, 30, 90, "30",$runs);
imagestring($graph, 30, 30, 140, "24",$runs);
imagestring($graph, 30, 30, 190, "18",$runs);
imagestring($graph, 30, 30, 240, "12",$runs);
imagestring($graph, 30, 30, 290, "6",$runs);
imagestring($graph, 30, 30, 340, "0",$runs);
//-----------------------------------------------------------------------------------------//
imageline($graph, 50, 350, 100, 300, $draw_line);
imageline($graph, 100, 300, 150, 320, $draw_line);
imageline($graph, 150, 320, 200, 220, $draw_line);
imageline($graph, 200, 220, 250, 290, $draw_line);
imageline($graph, 250, 290, 300, 30, $draw_line);
imageline($graph, 300, 30, 350, 330, $draw_line);
imageline($graph, 350, 330, 400, 130, $draw_line);
imageline($graph, 400, 130, 450, 50, $draw_line);
imageline($graph, 450, 50, 500, 270, $draw_line);
imageline($graph, 500, 270, 550, 179, $draw_line);
 
 
$ii=@imagecreatefromjpeg("pak_run.jpeg");
imagejpeg($graph,$ii,100);
imagedestroy($graph);
?>
ASKER CERTIFIED SOLUTION
Avatar of StraySod
StraySodFlag of Czechia image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers