need help.. urgent:(

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
omerfarooq123
Forum Newbie
Posts: 7
Joined: Thu Jul 09, 2009 3:27 am

need help.. urgent:(

Post by omerfarooq123 »

Hi again guyzz.. i wrote this script to open dir on my windows directory but it is not working.. as i am using windows so i can use both forward slash or backward slash but not working.. giving errors.. can some one tell me where is the problem?

Code: Select all

<?
$dir_name = "D:\xampp\htdocs\Opendir";
$dir = opendir($dir_name);
$file_list ="<ul>";
while ($file_name = readdir($dir)){
if (($file_name != "." && ($file_name != "..")){
$file_list .= "<li>$file_name";
}
}
$file_list .= "<ul>";
closedir($dir);
 
 
echo "$dir_name";
echo "$file_list";
 
?>
 
mellowman
Forum Commoner
Posts: 62
Joined: Sat Nov 22, 2008 5:37 pm

Re: need help.. urgent:(

Post by mellowman »

wait what?

Code: Select all

to open dir on my windows directory
Do you mean on a windows server or an apache server running off windows OS?

And here is a script i wrote before that works and echos out directory's 8O...

Code: Select all

    
<?php 
    $dirname = "THE PATH TO THE FOLDER OR FILE U WANT TO ECHO/"; 
    $dir = opendir($dirname); 
    while(false != ($file = readdir($dir))) { 
  if(($file != ".") and ($file != "..")) 
{ $fileChunks = explode(".", $file); {       
?>
        <br><a href="Google.com"><?php echo $file?></a> <------this is where it echos out 
<?php }}}closedir($dir); ?> 
 
omerfarooq123
Forum Newbie
Posts: 7
Joined: Thu Jul 09, 2009 3:27 am

Re: need help.. urgent:(

Post by omerfarooq123 »

well thanks but it is also giving me error bro.. i donot know why this script also giving me error

ERROR
Parse error: parse error in D:\xampp\htdocs\lesson9\disp.php on line 4
mellowman
Forum Commoner
Posts: 62
Joined: Sat Nov 22, 2008 5:37 pm

Re: need help.. urgent:(

Post by mellowman »

2 questions

1.Are you sure that the folder you are opening is there and the right CHMOD permissions...?

2.What did you mean '"to open dir on my windows directory"
Post Reply