Jump to content

Need help with this file uploading PHP script. Example of my script included. An


yepster123

Recommended Posts

I made the script below, this script merges too images together to create one image, this part isnt important. At the end of the script it says "imagepng($image); ". This outputs the final image and shows it on the screen which is good. But after this I want the script to upload the final image to my server, how would i do this?

 

The code:

 

<?php 

header('content-type: image/png'); 

$watermark = imagecreatefrompng('watermark.png'); 

$watermark_width = imagesx($watermark); 

$watermark_height = imagesy($watermark); 

$image = imagecreatetruecolor($watermark_width, $watermark_height); 

$image = imagecreatefromjpeg($_GET['src']); 

$size = getimagesize($_GET['src']); 

$dest_x = $size[0] - $watermark_width - 2; 

$dest_y = $size[1] - $watermark_height - 25; 

imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); 

imagepng($image);

?>

 

The path I want the new image to be uploaded to is:

/home/content/m/a/n/manage23/html/Stamped/

 

I just dont know how to do it.

I hope thats enough details provided for you to help me

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.