Jump to content


Photo

PHP different results fron different servers!


  • Please log in to reply
2 replies to this topic

#1 jumborex

jumborex

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 09 March 2013 - 03:32 AM

Hi, I'm trying to write a small graphic editor and I use HTML5, a JS library called fabricjs ( http://fabricjs.com/demos/ ). I've put the sequence upon 2 different servers: the first one is working perfectly: http://www.coalize.it/accordion.html

On the second server, the last pass, after having written a text, shows the image without ant text on it: apparently the original image.

http://www.messageon.../accordion.html

Should be noted that on the server the stored image is the one with text on it!

The image is passed to the page in a $_POST, in base64 format, via the previous form. The PHP executed at page loading is the following:

<?php
	unlink("transit/" . $_POST["trans_file"]);
	$filename = explode(".", $_POST["trans_file"]);
	$filesave = $filename[0] . ".png";
	$data = $_POST["base64img_data"];
	$data = explode(";", $data);
	$data = explode(",", $data[1]);
	$imagine=base64_decode(chunk_split($data[1]));
	$handle = fopen("transit/$filesave", "wb");
	fwrite($handle, $imagine);
	fclose($handle);
?>

This code is the same I use passing from the canvas with the image, to the page making the text: the canvas plus image is transformed in PNG, used as a background for the canvas, then the text part is executed.

I cannot really image why the execution is different from the two servers!

Help, please.



#2 ulferik

ulferik

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 28 March 2013 - 05:21 AM

Don't know the answer, but you have a security vulnerability in line #2.



#3 trq

trq

    Advanced Member

  • Administrators
  • 30,723 posts
  • LocationSydney, Australia.

Posted 28 March 2013 - 05:18 PM

Both examples look exactly the same to me.

I'm not sure that the description your giving coincides with the code either.

I don't see any usage of fabricjs or the canvas element, nor do I see how that would relate to the php code you have posted.

http://thorpesystems.com | http://proemframework.org | http://github.com/trq

SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
OPM - My Linux package manager.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com