Hello all,
I am running into a little trouble with my currect project. I am a webadmin for a school district. I am using php and apache on a netware server. I have several different schools and within each school I have several different folders that contain teachers websites. So basically each folder is the teacher's username (ssmith etc). Instead of adding code each time a new teacher wants to build a website I thought I would create some code that would populate a dropdown box on the school index with the username's of the teacher folders within the main school directory.
Basically all I want the option of doing is choosing selecting the teacher's website to go to from a dropdown list. This is what I have so far.
html....
This code fills the list box just fine with the user names but I am at a loss as to how to proceed at forwarding the user on to the teacher's website. All I would need to do is add www.myschool.com/schools/site/username/ onto the end of the existing url because I am making the teachers have an index file.
Can anyone give me any pointers on how to procede?
Thanks.
I am running into a little trouble with my currect project. I am a webadmin for a school district. I am using php and apache on a netware server. I have several different schools and within each school I have several different folders that contain teachers websites. So basically each folder is the teacher's username (ssmith etc). Instead of adding code each time a new teacher wants to build a website I thought I would create some code that would populate a dropdown box on the school index with the username's of the teacher folders within the main school directory.
Basically all I want the option of doing is choosing selecting the teacher's website to go to from a dropdown list. This is what I have so far.
html....
Code:
<select name = yes>
<?
$dir = "/path/to/school/site/"; //sets directory path
// Open a known directory, and proceed to read its contents
if (is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false) //while files and folders are being read
{
if (filetype($dir . $file) == dir) //if the filetype is a directory and not a file
{
echo '<option value="'.$file.'">',
$file, '</option>';
}
}
closedir($dh);
}
}
?>
</select>
<input type="submit" value="Edit">
This code fills the list box just fine with the user names but I am at a loss as to how to proceed at forwarding the user on to the teacher's website. All I would need to do is add www.myschool.com/schools/site/username/ onto the end of the existing url because I am making the teachers have an index file.
Can anyone give me any pointers on how to procede?
Thanks.