Answer the question
In order to leave comments, you need to log in
What does this php code do?
What does this php code do I need to analyze it as a beginner I don't understand everything in php
<?php
$id = $_GET["id"];
$urlimg = 'http://i500.mycdn.me/getImage?photoId='.$_GET['urll'].'&type=6';
// Load the stamp and the photo to apply the watermark to
$stamp = imagecreatefrompng('new/'.$_GET["numm"].'.png');
$ran_dom = rand (1 , 2);
$im3 = imagecreatefromjpeg($urlimg);
imagecopy($im3, $stamp, 0, 0, 0, 0, 128, 128);
// Output and free memory
header("Content-Type: image/png");
imagepng($im3, 'images/'.$id.'.png');
imagedestroy($im3);
?>
Answer the question
In order to leave comments, you need to log in
but how to put more watermarks there by default 1
<?php
$id = $_GET["id"];
$urlimg = 'http://i500.mycdn.me/getImage?photoId='.$_GET['urll'].'&type=6';
// Load the stamp and the photo to apply the watermark to
$stamp = imagecreatefrompng('new/'.$_GET["numm"].'.png');
$ran_dom = rand (1 , 2);
$im3 = imagecreatefromjpeg($urlimg);
imagecopy($im3, $stamp, 0, 0, 0, 0, 128, 128);
$im4 = imagecreatefromjpeg($urlimg); // Second watermark
imagecopy($im3, $im4, 0, 0, 0, 0, 128, 128);
// Output and free memory
header("Content-Type: image/png");
imagepng($im3, 'images/'.$id.'.png');
imagedestroy($im3);
?>
As I understand it: Loads an image from the source, converts it to png and applies a watermark, and then displays the image.
Google Translate + knowledge of php = everything is clear and understandable)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question