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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.