Okay you basicly want them to be able to enter a username and gain access to three files based on my understanding of this here is my help
Think of an array like a Treeview or XML file you can have a simple array
array(apple, plum, pear);
or you could have a mor complex multidimensional array. Now I know this sounds a little bit stephen hawking but it's just like having a child node so think of multidimensional arrays like
parent1
child1
grandchild1
grandchild2
parent2
child1
grandchild1
grandchild2
grandchild3
grandchild4
child2
grandchild1
parent3
child1
grandchild1
grandchild2
grandchild3
now essentially a multidimensional array could encompas the whole family tree but for this we would probably like to use a database instead. creating arrays drains php's resources until it adversely affects the entire script.
what you want is a multidimensional array in this format
array
username1
alpha file
beta file
gamma file
username2
alpha file
beta file
gamma file
to access the username username1 it would be array[0];
to access the alpha file fr username 1 it would be array[0][0];
to access the beta file from username 1 it would be array[0][1];
and so on if you find this hard you can have user1 and include the file for user1 which would contain the array data for user1
if(file_exists($userdir.$_POST['uname'].$extension)){
include ($userdir.$_POST['uname'].$extension);
}
if(!file_exists($userdir.$_POST['uname'].$extension)){
echo "this is an invalid username please die!";
}
😃