I am writing a simple PHP file to upload a file on POST, and to also create a new image and include the path to that new image in the response.
For the JSON response I have set headers in the main PHP file that the POST is sent to - like so:
header("Content-Type: application/json");
Just before my JSON encoded echo this is.
Above that part I call a function from another PHP file that uploads the POST file, and one that is called after that rendering a different image using that uploaded file.
In that function in order to create the PNG file I need put on the disc I have to declare a new header right? Like so:
header("Content-type: image/png");
I then ofc get the doublet header problem.
How can I get around this problem?
I cannot use header_remove() BTW.