0

I have the subdomain https://i.luckvintage.net. I use this website to send images easily to my clients using ShareX. A file is automatically uploaded to this website when I press the Print Screen Button. An example of a URL with an image is here:

image1

I would like to collect statistics for how many people view the images etc using a third-party website. In order to do this, I need to embed some code into a file. How can I make PHP display an image in the URL Form https://i.luckvintage.net/image.php?id=chrome_1ZVoGRTlVv.png instead?

Many Thanks.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • 4
    Show us what you've tried. Please read: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) and also [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) – M. Eriksson Apr 21 '19 at 12:17

1 Answers1

0

You could do with iframe and set img as src

<?php
  if(isset($_REQUEST['id'])){
   ?>
      <style media="screen">
      iframe{
        position: fixed;
        overflow: auto;
        width: 100%;
        height:100%;
        left:0px;
        top:0px;
        border:none;
      }
    </style>


    <iframe src="https://i.luckvintage.net/<?=$_REQUEST['id']?>" width="100%" height="100%"></iframe>

  <?php

 }


?>
prasanth
  • 22,145
  • 4
  • 29
  • 53
  • Thank you for your answer! I put this code into the file image.php but I get an internal server when I try to access the URL. What am I doing wrong? –  Apr 21 '19 at 12:28
  • sorry `if condition )` is missing .Copy paste my edited answer – prasanth Apr 21 '19 at 12:32
  • for my advice enable error_reporting on you [`php.ini`](https://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php) on development mode – prasanth Apr 21 '19 at 12:34
  • 1
    Alright, thank you so much for the code and advice. I'll enable error reporting in my php.ini file. –  Apr 21 '19 at 12:36
  • How would I make the image fit the whole screen? If you look at this image i've just taken you can see that the image is alot bigger than it should be, and does not fit in the browser smoothly. Thanks. https://i.luckvintage.net/image.php?id=/kB5ZbJa1lZ.png –  Apr 21 '19 at 12:51