php

Site Update

Behind the scenes, the site has been updated to the most recent version of the CMS that powers it. Will be updating/checking PHP code to make sure it is compatible with PHP 5. May also update old Flash articles to ActionScript 3.

      Subscribe in a reader

Being part of a community of practise as a programmer

What is a Community of Practise?

A community of practice (CoP) is an most often and informal, gathering where the participants come together to learn and support each other. Professional institutes may contain CoPs - mostly in the form special interest groups (SIGs). There can also be software user groups.

Community of practise model
Purpose: Engage actors in communities that learn

      Subscribe in a reader

Stream music with Music Browser

Music Browser is 'a light-weight web-based browser and streamer for you music collection.' It requires a web server with at least PHP4.2+ and 200mhz CPU with 32MB of RAM.

It might be interesting to try this on WOS.

      Subscribe in a reader

PHP Resources

      Subscribe in a reader

Deleting a file

Deleting a file

Simple file delete example using a form

Migrated forum post

I received an email about deleting a file and I'm posting part of my reply here. I may expand it to be a full tutorial.

The unlink() function deletes files in PHP. http://www.php.net/manual/en/function.unlink.php

You should have read/write privileges to the directory that you're going to be deleting from (chmod 777)

This is a simple example of using a form to delete a file.

Code:

<?php
if ($submit && $deleteimage) {

function Delete_Photo($name){
$delete = unlink($name);

      Subscribe in a reader

Creating and deleting directories

Creating and deleting directories

Script showing how to create/delete directory

Migrated forum post

Script showing how to create/delete dirs.

Code:

This creates a directory that has a mode of 777.

Code:

<?php
if ($makedir == "MakeDir") {
$newdir = "$dirname";
$dirmake = mkdir("$newdir", 0777);

print
"<a href="$newdir">View New Directory</a>n";
}
?>


<form action="<? $PHP_SELF; ?>">
<input type="text" name="dirname">
<input type="submit" name="makedir" value="MakeDir">
</form>

      Subscribe in a reader

Regex Coach

The Regex Coach

Content formatting with Regexes

The Regex Coach a graphical application for Linux and Windows which can be used to experiment with (Perl-compatible) regular expressions interactively.

weitz.de/regex-coach.

      Subscribe in a reader

PHP On-The-Fly!

PHP On-The-Fly! by Dennis Pallett

Introduction PHP can be used for a lot of different things, and is one of the most powerful scripting languages available on the web. Not to mention it's extremely cheap and widely used. However, one thing that PHP is lacking, and in fact most scripting languages are, is a way to update pages in real-time, without having to reload a page or submit a form.

      Subscribe in a reader

Design an Online Chat Room with PHP and MySQL

Design an Online Chat Room with PHP and MySQL by Rory Canyon

In this article, you will learn how to design and develop a simple online chat room with PHP and MySQL. This tutorial explains every steps of the development, including both database design and PHP programming. Basic computer skills and knowledge of HTML and PHP are required. Ok, let's begin now.

Step 1: Design Database Table.

Create table "chat" in MySQL database to store basic chat information: chtime (chat time), nick (user nickname) and words (chat message, less than 150 characters)

mysql> CREATE TABLE chat

      Subscribe in a reader

Using fgetscsv function

Using fgetscsv function

Reading the data saved in CSV file format

fgetcsv -- Gets line from file pointer and parse for CSV fields

Fgetcsv() example - Read and print entire contents of a CSV file
The field delimiter is assumed to be a comma, unless you specify another delimiter with the optional third parameter.

PHP Code
<?php

$fp = fopen('csvfile.txt','r');
while($line = fgetcsv($fp,'1024',',')){
echo "";
print_r($line);
echo "";

/*
foreach($line as $value){
echo "$value

      Subscribe in a reader
Syndicate content