Php

From neil.tappsville.com
Jump to navigationJump to search

PHP Scripts

Proxy an image from a local system that requires authorisation, such as a internal Security DVR, no proxy required. Save this image.php and wa-la

<?php
$temp = file''get''contents('http://user:password@host.com/cgi-bin/guest/Video.cgi?media=JPEG');
header("content-type: image/jpeg");
echo ($temp);
?>

BBClone

As the developers say 'A PHP based Web Counter on Steroids', this is what I used to use to count unique vistors on the main site Unfortunately it fell out of favour - its must easier to get google to do this for you.

To upgrade to a newer version.

  • Copy all files except /var
  • Then reconfigure conf/config.php

Librenms

Wierd quirk on the dashboard where links in the Availability Map or World Map do not go to devices. Instead of https://librenms/device/device=2/ the url is https://librenms/@deviceUrl($device)

Librenms uses a php module called Laravel which essentially caches/stashes values in a a hidden form, sometimes the cache needs to be cleared (n.b a restart of httpd nor a reboot of the host fixed this) - magical fix is php artisan view:clear

Found: https://codeburst.io/just-in-case-laravel-create-custom-blade-directive-b60a7160949d


CSS and HTML Validators