ICT News and Updates

because information is for everybody…

PHP File Download

<?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 [...]

  • Share/Bookmark

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 [...]

  • Share/Bookmark

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(); [...]

  • Share/Bookmark

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 = [...]

  • Share/Bookmark
  

Recent Entries

    Recent Comments

      Most Commented