Help - Search - Members - Calendar
Full Version: Php Problem
Linuxhelp > Support > Programming in Linux
Termina
This script used to work (and IIRC) I havn't changed anything.

Then again, I havn't tried/looked at this script in months.

Anyone see anything wrong?

Description: Gets the foldernames from /home, and shows them as a link, as well as the contents of their .plan file

Permissions of /home = 755
all folders in /home are = 705
owner = username of folder
group that owns each = users

CODE
<body bgcolor="#000000">
<CENTER>
<?

   include("layout.php");
   function add_page_content() {
   $hubDir = '/home';
   foreach(glob("$hubDir/*") as $filename)
{
   if( is_dir($filename) && is_file("$filename/.plan") )
   {
       $username = explode("/",$filename);
       $username = $username[count($username)-1];
       $filedata = file_get_contents("$filename/.plan");
       echo "<a href="~{$username}/">$username</a><br />$filedata<br /><br />";
   }
}
?>

<? } //End ?>
DS2K3
Could be that you dont have register_globals turned on - in which case any GET or POST data will obly be present in the superglobals.

What version of PHP are you using?
Hemant
I dont see any forms(data transaction with user),so i doubt that is required.correct me,if i am wrong

But there might be a problem with file permission.Why dont you create a group and make apache and the user, members of that group and then give read access to the group.

Anyway,that is just a suggestion.What errors the script throws?

Try to run the script with php executable,like this....
CODE
$php filename.php

and tell us what happens.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.