开发者

Validation of existence per result on a indexed list, mysql/php

开发者 https://www.devze.com 2023-01-19 13:38 出处:网络
We have a directory system that lists people with their credentials such as email phone and etc Their web profile link is also listed.

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 joe01@school.com 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 data开发者_如何学编程base 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


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
}
0

精彩评论

暂无评论...
验证码 换一张
取 消