I have two javascript variables var 1 and var 2 which I need to pass to PHP through GET method.
$('#output_images').html('<img src="MergeIcons.php?icon1=var1&econdIcon=var2 />');
In my .php file, I merge two icons using GD PHP and send the image back using imagepng.
$firstIcon = $_GET['icon1'];
$secondIcon = $_GET['icon2'];
// Process images
header('Content-Type: image/png');
imagepng($dest);
When I pass the direct image path and dont use the var1 and var 2 it works fine, but with var1 and var 2 it doesnt work. What could be the problem?