Announcements | Last Post | |
---|---|---|
SoC Curricula | 09/30/2017 01:08PM | |
Demarcation or scoping of examinations and assessment | 02/13/2017 07:59AM | |
School of Computing Short Learning Programmes | 11/24/2014 08:37AM | |
Unisa contact information | 07/28/2011 01:28PM |
Re: Task 3A and Task 3B August 05, 2010 07:28AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Task 3A and Task 3B August 05, 2010 04:56PM |
Registered: 13 years ago Posts: 7 Rating: 0 |
Re: Task 3A and Task 3B August 09, 2010 12:28PM |
Registered: 13 years ago Posts: 21 Rating: 0 |
Re: Task 3A and Task 3B August 09, 2010 01:04PM |
Registered: 13 years ago Posts: 6 Rating: 0 |
Re: Task 3A and Task 3B August 09, 2010 01:34PM |
Registered: 13 years ago Posts: 19 Rating: 0 |
Re: Task 3A and Task 3B August 09, 2010 02:58PM |
Registered: 15 years ago Posts: 79 Rating: 0 |
Re: Task 3A and Task 3B August 09, 2010 03:03PM |
Registered: 15 years ago Posts: 79 Rating: 0 |
Re: Task 3A and Task 3B August 11, 2010 08:55PM |
Registered: 15 years ago Posts: 14 Rating: 0 |
Re: Task 3A and Task 3B August 14, 2010 02:34PM |
Registered: 13 years ago Posts: 64 Rating: 0 |
Language: PHP<?php /*This script creates a directory navigation script that allows users to view the contents of a directory as well as the contents of the files within the directory.*/ $dir = NULL; if(!$dir) $dir = ("./"); $dp = opendir($dir); echo "<table border=';0'; width =';100%'; cellspacing=';0'; cellpadding=';0';>\n"; while($filenames[] = readdir($dp)); sort($filenames); for($i = 0; $i < count($filenames); $i++) { $item = $filenames[$i]; if(is_dir($item)) { if($item != ';.'; && $item != ';..';) echo "<tr><td width=';100%';><a href=';".$_SERVER[';PHP_SELF';]."?dir=".$dir.$item."';>".$item."/</a></td></tr>\n"; } else echo "<tr><td width=';100%';><a href=';$dir/$item';>$item</a></td></tr>\n"; } echo "</table>"; ?>
Re: Task 3A and Task 3B August 14, 2010 05:00PM |
Registered: 13 years ago Posts: 35 Rating: 0 |
Re: Task 3A and Task 3B August 15, 2010 01:29PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Task 3A and Task 3B August 19, 2010 11:00AM |
Registered: 13 years ago Posts: 64 Rating: 0 |
Language: PHP<?php /*This script creates a directory navigation script that allows users to view the contents of a directory as well as the contents of the files within the directory.*/ $dir = NULL; $dir = $_GET[';dir';]; if(!$dir) $dir = ("./"); $dp = opendir($dir); echo "<table border=';0'; width =';100%'; cellspacing=';0'; cellpadding=';0';>\n"; while($filenames[] = readdir($dp)); sort($filenames); for($i = 0; $i < count($filenames); $i++) { $item = $filenames[$i]; if(is_dir($item)) { if($item != ';.'; && $item != ';..';) echo "<tr><td width=';100%';><a href=';".$_SERVER[';PHP_SELF';]."?dir=".$dir.$item."';>".$item."/</a></td></tr>\n"; } else echo "<tr><td width=';100%';><a href=';$dir/$item';>$item</a></td></tr>\n"; } echo "</table>"; ?>
Re: Task 3A and Task 3B August 19, 2010 11:11AM |
Registered: 13 years ago Posts: 93 Rating: 0 |
Re: Task 3A and Task 3B August 19, 2010 05:05PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Task 3A and Task 3B August 20, 2010 10:18AM |
Registered: 13 years ago Posts: 21 Rating: 0 |
Re: Task 3A and Task 3B August 20, 2010 01:43PM |
Registered: 13 years ago Posts: 64 Rating: 0 |
Language: PHP<?php /*This script creates a directory navigation script that allows users to view the contents of a directory as well as the contents of the files within the directory.*/ //We want to see if it exists or not because we cannot say "if it doesn';t exist" without checking if it exists or not. $dir = $_GET[';dir';]; if (!$dir) $dir = ("./"); $dp = opendir($dir); echo "<table border=';0'; width=';100%'; cellspacing=';0'; cellpadding=';0';>\n"; while($filenames[] = readdir($dp)); sort($filenames); for ($i = 0; $i < count($filenames); $i++){ $item = $filenames[$i]; if (is_dir($item)) { if($item != ';.'; && $item != ';..';) echo "<tr><td width =';100%';><a href=';".$_SERVER[';PHP_SELF';]."?dir=".$dir.$item."';>".$item."/</a></td></tr>\n"; } else {echo "<tr><td width=';100%';><a href=';".$dir."/".$item."';>{$item}</a></td></tr>\n"; } } echo "</table>"; ?>
Re: Task 3A and Task 3B August 23, 2010 07:14AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Task 3A and Task 3B August 24, 2010 06:43AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Language: PHPif(isset($_GET[';dir';])) { $dir = ("./"); $dp = opendir($dir); ......... } //or if(!isset( $_GET[dir])) { $_GET[dir]=""; } //or echo (isset($_GET[';dir';])) ? $_GET[';dir';] : ""; // which is another way of say if/else - the part after the ? is the 1st bracket code and the part after the : is the else part.
Re: Task 3A and Task 3B August 24, 2010 11:55PM |
Registered: 13 years ago Posts: 93 Rating: 0 |
Re: Task 3A and Task 3B August 25, 2010 07:12AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Task 3A and Task 3B August 25, 2010 10:34AM |
Registered: 13 years ago Posts: 64 Rating: 0 |
Re: Task 3A and Task 3B September 02, 2010 03:25PM |
Registered: 13 years ago Posts: 28 Rating: 0 |
Re: Task 3A and Task 3B September 05, 2010 02:26PM |
Registered: 14 years ago Posts: 28 Rating: 0 |
Re: Task 3A and Task 3B September 09, 2010 08:27AM |
Registered: 14 years ago Posts: 10 Rating: 0 |
Re: Task 3A and Task 3B September 13, 2010 11:53AM |
Registered: 13 years ago Posts: 5 Rating: 0 |
Re: Task 3A and Task 3B September 28, 2010 01:26PM |
Registered: 13 years ago Posts: 21 Rating: 0 |
Anonymous User
Re: Task 3A and Task 3B October 09, 2010 03:25PM |
Rating: 0 |