Answer the question
In order to leave comments, you need to log in
What could be the problem with screen capture in php?
Essentially, this code takes a fullscreen screenshot of the screen.
$path = $_SERVER["DOCUMENT_ROOT"].'/core/img/screen/';
$names = time().".png"; $im = imagegrabscreen();
imagepng($im, $path.$names);
imagedestroy($im);
$link = 'https://'.$_SERVER["HTTP_HOST"].'/core/img/screen/'.$names;
Answer the question
In order to leave comments, you need to log in
imagegrabscreen only works on Windows ( https://www.php.net/manual/ru/function.imagegrabsc...
As a rule, PHP hosting uses Linux, so the function does not work there.
The problem is not understanding where PHP is running
From the link above, you can make a surprising discovery for yourself that PHP is running on the server.
When you find a screen at the server and you are interested in what is drawn on it, you can take a screenshot.
And if you are interested in the user's screen, then you have to remember where PHP works.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question