Wednesday, January 23, 2008

Display Current Directory Files

Apache usually will display the default web pages usually index.php or index.html where you had predefine in your configuration files. So how could we display other files easily? The best way to implement is that you create a file which will output all files in the directory. Below is example of how could u implement.

Save the as index.php


<html>

<?php

/**zfm
* Name this file index.php and place in the directory.
*/


//Data Initialization
$counter = 1;


// Define the full path to your folder from root
//$path = "put the full path here";
$path = "./.";

// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");

echo "<font size=5>Directory folder</font><br><br>";

// Loop through the files
while ($file = readdir($dir_handle)) {

if($file == "." || $file == ".." || $file == "index.php" )

continue;
echo $counter." <a href=\"$file\">$file</a><br>";

$counter+=1;

}

// Close
closedir($dir_handle);

?>
</html>

Tuesday, January 22, 2008

Change Apache Listening Port

How to change Apache Listening port?
As default apache port was 80 or 8080. If the port had been use by other program the apache could not be started.

To change the default port to desired port, open the apache configuration file.
By default the file located at:
C:\Program Files\Apache Software Foundation\Apache2.2\conf

Open httpd.conf

Then find "Listen" Change the default number to your prefered number.

Eg: Listen 1000

Monday, January 21, 2008

PHP5 MYSQL5 APACHE 2.2

Recently PHP had been use widely.It was an Open Source product where the development of it continues for year until now. Dynamic scripting can be done easily, manipulating codes to do what we want and with many tools available to debug & run php, the popularity of php remained.

Lets us explore the world of php together.