Forums

PHP

This topic is locked

the link doesnt work, help

Posted 12 Oct 2006 21:24:43
1
has voted
12 Oct 2006 21:24:43 ede edd posted:
hi ,

i'm using this code to link files in the documents folder

[php]<?php
if ($handle = opendir('C:\apache\htdocs\Upload documents\documents'))
{
while (false !== ($file = readdir($handle)))
{
echo "<a href='$file'>$file</a> <br /> \n";
}
closedir($handle);
}
?>
[php]
out put :

documents_A.php
documents_B.php
documents_C.php
sample.doc


but when i clicked on the link it shows an error- internal server error
if i change the dir to C:\apache\htdocs\Upload documents\ it works, every file and folder is displayed correctly.

what do i have to do to for the links to the "documents" folder to work?

hope u could help

Replies

Replied 17 Oct 2006 07:02:25
17 Oct 2006 07:02:25 micah santos replied:
the only problem that i can see here is the path

try to change the path like this:

C:\apache\htdocs\Upload~1\docume~1

Reply to this topic