Uploading an external php file using jquery is actually simple. I just use the load () event.
Like this:
$("#someelement").load('somepage.php');
This is usually just fine, as long as I don't use the image manipulation functions.
Here is what I put inside somepage.php
<?php
$img = 'tmp/someimage.png';
$img = imagecreatefrompng($img);
header('Content-type: image/png');
imagepng($img);
?>
When somepage.php loads, I return the wrong code. (that I'm not sure what this will be considered)
I am sure there is a restriction on loading complex image functions, but I thought I would ask if there is a workaround.
source
share