hi guys...got some questions regarding on my script....
<?php
error_reporting(0);
$w = (int)$_POST['width'];
$h = (int)$_POST['height'];
$img = imagecreatetruecolor($w, $h);
imagefill($img, 0, 0, 0xFFFFFF);
$rows = 0;
$cols = 0;
for($rows = 0; $rows < $h; $rows++){
$c_row = explode(",", $_POST['px' . $rows]);
for($cols = 0; $cols < $w; $cols++){
$value = $c_row[$cols];
if($value != ""){
$hex = $value;
while(strlen($hex) < 6){
$hex = "0" . $hex;
}
$r = hexdec(substr($hex, 0, 2));
$g = hexdec(substr($hex, 2, 2));
$b = hexdec(substr($hex, 4, 2));
$test = imagecolorallocate($img, $r, $g, $b);
imagesetpixel($img, $cols, $rows, $test);
}
}
}
header("Content-type:image/jpeg");
imagejpeg($img, "", 95);
?>
...as you can see, the image comes from a POST variables. the problem here is that the image could be viewed but its not on the server. could somebody help me please how to make that image thats been generated with my php script to be on the server already? upon generated, it would be on the server already.
thank you very much!