landysaccount Posted April 21, 2009 Share Posted April 21, 2009 Hello. I would like to know if is possible to read a client's file from a known location? I need to run some sort of authentication by reading a file's content on the client and comparing it to the one in a database. I don't know what technique to use to implement it. Thanks in advanced for your help. Quote Link to comment https://forums.phpfreaks.com/topic/155114-read-a-client-file/ Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 21, 2009 Share Posted April 21, 2009 Very simple : http://www.php.net/manual/en/function.file-get-contents.php With more options : http://www.php.net/manual/en/book.curl.php Quote Link to comment https://forums.phpfreaks.com/topic/155114-read-a-client-file/#findComment-815959 Share on other sites More sharing options...
soak Posted April 21, 2009 Share Posted April 21, 2009 You talking about cookies or a file on their c: drive? Quote Link to comment https://forums.phpfreaks.com/topic/155114-read-a-client-file/#findComment-815960 Share on other sites More sharing options...
landysaccount Posted April 21, 2009 Author Share Posted April 21, 2009 A file in the C drive. Since the cookies are cleared once in a while hence, this file would be removed everytime the client clears it's temp files. Quote Link to comment https://forums.phpfreaks.com/topic/155114-read-a-client-file/#findComment-815965 Share on other sites More sharing options...
taith Posted April 21, 2009 Share Posted April 21, 2009 seeing as php runs solely on the server end, and javascript is mostly sandboxed away from file level functions on the client computer... no you cant... Quote Link to comment https://forums.phpfreaks.com/topic/155114-read-a-client-file/#findComment-815970 Share on other sites More sharing options...
landysaccount Posted April 21, 2009 Author Share Posted April 21, 2009 So, I guess I'm stuck with cookies then. I will need something that would generate the cookie at the client's side. Can cookies be handled with php at the client side? Which one is better to use for cookies: JS or PHP? Quote Link to comment https://forums.phpfreaks.com/topic/155114-read-a-client-file/#findComment-815974 Share on other sites More sharing options...
premiso Posted April 21, 2009 Share Posted April 21, 2009 setcookie As far as which is better, PHP or JS Cookie setting. They do the same thing, but Javascript can be disabled, so PHP would be more "Reliable" in a sense. Quote Link to comment https://forums.phpfreaks.com/topic/155114-read-a-client-file/#findComment-815996 Share on other sites More sharing options...
landysaccount Posted April 22, 2009 Author Share Posted April 22, 2009 Ok. Thanks everyone for your help. I appreciate it. Quote Link to comment https://forums.phpfreaks.com/topic/155114-read-a-client-file/#findComment-816007 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.