PHP Classes

File: src/example.php

Recommend this page to a friend!
  Classes of Luciano Salvino   PHP Safe Image Preview   src/example.php   Download  
File: src/example.php
Role: Example script
Content type: text/plain
Description: example
Class: PHP Safe Image Preview
Blur an image when it is not safe for non-adults
Author: By
Last change: Update of src/example.php
Date: 1 year ago
Size: 1,161 bytes


Class file image Download


// Init
$safePreview = new SafePreview();
// set lang
// set logo path
$pathLogo = 'images/logo/logo.png';
// set image path
$pathImage = 'images/origin/image.jpg';
// set image blured path
$pathBlured = 'images/blured/blured.jpg';
// set image url
$urlImage = 'http://{YOUR_URL}/safePreview/src/images/origin/image.jpg';
// set image blured url
$urlBlured = 'http:/{YOUR_URL}/safePreview/src/images/blured/blured.jpg';
// set the condition (add alert message: do you want to see it anyway?)
// verify if image safe
$isSafe = $safePreview->isImageSafe();
$isSafe) {
// if image not safe
// show blured image
$html = $safePreview->showPreview();
} else {
// show original image
$html = $safePreview->showOriginal();


<script src=""></script>
<?php echo $html;?>