<?php
// place this code inside a php file and call it f.e. “download.php”
$path = $_SERVER['DOCUMENT_ROOT'].”/path2file/”; // change the path to fit your websites document structure
$fullPath = $path.$_GET['download_file'];
if ($fd = fopen ($fullPath, “r”)) {
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);
switch [...]
15 Oct
Posted by admin as Announcements, PHP Scripts and Tools
Students who are interested to try this problem can earn and extra points or exemption for finals. Solve the problem using PHP scripting language.
Show your codes on October 19, 2008 (9:00) to your instructor for checking and evaluation.
The problem was excerpt from HP CodeWars 2009.
Redundant Acronym Syndrome Syndrome
Task Description
From Wikipedia, the free encyclopedia:
The term RAS [...]
13 Sep
Posted by admin as PHP Scripts and Tools, Technology Tips, Trainings
Here is my example of creating a graph using an object – PHPLOT. PHPLOT is an easy-to-use object which is now available and freeing yourself from lengthy code. The only requirement is your knowledge in using a class, properties and methods. The object is available is around the corner.
*********************************/
require_once(“mysqlidb.class.php”);
require_once(“config.php”);
require_once(“phplot.php”);
/* initialize connection */
$report = new mysqlidb(DB_HOST,DB_USER,DB_PWORD,DB_DATABASE);
$report->dbConnect(); [...]
The script below is a sample on how to create a bar graph using PHP language.
$arr_value = array(1 => 10, 2 => 20, 3 => 30, 4 => 40, 5 => 50);
/* image size and margin */
$img_height = 400;
$img_width = 600;
$margins = 20;
/* size of the graph – subtracting the size of borders */
$graph_width = [...]
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « May | ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |