Including a file from root directory (PHP)

This is how to include a file from your root directory of your host provider. You will find this useful if you have files that you need to include from sub folders.

<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include "$root/ExampleFolder/functions.php";
?>

Change this

/ExampleFolder/functions.php

to the required destination of the file.


Comments: 0 Date: 27 Dec

Entire Div into a link

Heres how to make the a entire Div “clickable” with some simple Javascript.

<div onclick="location.href='http://www.example.com';" style="cursor:pointer;"></div>

or for WordPress use this

<div id="header" onclick="location.href='<?php bloginfo('url');?>';" style="cursor:pointer;"></div>

Simple!


Comments: 0 Date: 19 Sep
There are no more posts