title: Check if php script was called by the server or remotely in php?
body: <p>I have a crontab php script that resides in one of the folders on abc.tld.
  The problem is that the script could also be fired by calling it directly (i.e. <a href="http://abc.tld/crontab.php" rel="nofollow noreferrer">http://abc.tld/crontab.php</a>)
  To eliminate such possibility, I assume, I could do something like</p>
  
  <pre><code>if( isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR']) )
       die( 'Never gonna happen!' );
  </code></pre>
  
  <p>But what is the right way? (except .htaccess)</p>
  
  <p>Crontab entry:</p>
  
  <pre><code>0 12 * * 1  /usr/local/bin/php /home/pavellebedev/public_html/abc.tld/wp-content/plugins/easy-timesheet/kernel/cron/ezts_timesheet_notifications.php
  </code></pre>