Post Reply 
Quick Php help
Author Message
Mickey
Down with MJ yo

Posts: 3,663.2843
Threads: 251
Joined: 26th Apr 2008
E-Pigs: 28.7300
Offline
Post: #1
Quick Php help

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
$id = $_GET['id'];
if ($id !== NULL) {
$dir = $id;
$files = scandir($dir);
foreach ($files as $url) {
	if ($url == ".." OR $url == ".") {
		end;
	  } else {
	echo "<a href=\"./{$dir}/{$url}\">".$url."</a></br>";
	}


} else {
echo("Select a folder from the left pane."); 
}
?>

Why can't i get the if loop to work? Page won't load when I have that in, and if i don't i get damn . and .. and links Erk
Any help would be greatly appreciated. Probably my own stupidity. Emptyone

Like i said, it was my own stupidity, i was missing a "}". I really need to turn on error reporting Sadist


[Image: MiCk3Y.jpg]

[Image: battle.png]

Spoiler for link:
(This post was last modified: 25/04/2009 11:27 PM by Mickey.)
25/04/2009 11:21 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Quick Php help - Mickey - 25/04/2009 11:21 PM
RE: Quick Php help - amzter - 26/04/2009, 02:36 AM
RE: Quick Php help - lembas - 26/04/2009, 02:40 AM
RE: Quick Php help - amzter - 26/04/2009, 03:08 AM
RE: Quick Php help - ZiNgA BuRgA - 26/04/2009, 03:18 AM
RE: Quick Php help - Mickey - 26/04/2009, 10:07 AM
RE: Quick Php help - Mickey - 29/05/2009, 12:36 AM
RE: Quick Php help - ZiNgA BuRgA - 29/05/2009, 01:13 AM
RE: Quick Php help - Mickey - 29/05/2009, 01:27 AM
RE: Quick Php help - Mickey - 29/05/2009, 06:25 AM
RE: Quick Php help - ZiNgA BuRgA - 29/05/2009, 06:37 AM
RE: Quick Php help - Mickey - 29/05/2009, 06:39 AM
Thread Revived!!! - Necro-Bot - 29/05/2009, 12:36 AM

Forum Jump:


User(s) browsing this thread: 5 Guest(s)

 Quick Theme: