views:

25

answers:

1

We have a directory system that lists people with their credentials such as email phone and etc Their web profile link is also listed. but this link is created by taking the email username and adding it to a link. so [email protected] has a profile page at school.com/user/joe01

currently there is no validation to check if the actual user profile page exists but what i do have is access to the database of the users which has their username and email listed

i was thinking of comparing as the results are shown but this is incredibly stupid since its a live search directory meaning every time it will be comparing hundreds of results and this will my make Admin very sad.

so the user profile database has to be cached then the usermails from the directory database needs to be compared to it.

the question is what is the best way to do this caching, a txt file? suggestions please

A: 

i was thinking of comparing as the results are shown but this is incredibly stupid

Perhaps I'm missing something but I don't see how it's stupid to check this during results iteration. You could form the URI, translate it to the real path and check for its existence in the file system:

if (is_dir($_SERVER['DOCUMENT_ROOT'].'/user/joe01')) {
    // print link
}
webbiedave
i see, i did not mean checking if the URI exists, because the URI does not exist its generated, there is no directory like that its a permalink
vache