ndondo Posted November 23, 2007 Share Posted November 23, 2007 This is the scenario that I have I have a website it is username and password protected. What I would like to do is if a computer goes to my website. I want to check if the computer has ndondo.txt (for example) in C:\ndondo\ndondo.txt folder if it exist, I would like to grant login to the user without having to enter username and password Quote Link to comment Share on other sites More sharing options...
Orio Posted November 23, 2007 Share Posted November 23, 2007 You can't do that. PHP has nothing to do with stuff like that. Orio. Quote Link to comment Share on other sites More sharing options...
clanstyles Posted November 23, 2007 Share Posted November 23, 2007 lawls.... use cookies. Save data that way. setcooke("NameOfCookie", "Value", time() + 30 * 24 * 60 * 60) Quote Link to comment Share on other sites More sharing options...
ndondo Posted November 23, 2007 Author Share Posted November 23, 2007 can I get recommendation on how to implement this I have customers and I am creating a support website (PHP based website) for them now I need to have username and password, so that only my customer can see this website but I don't want to add more problem for my customer to login everytime they would like to use the support website... any suggestion would be great Quote Link to comment Share on other sites More sharing options...
revraz Posted November 23, 2007 Share Posted November 23, 2007 Search for Cookies and Sessions, you'll find a ton of code, tutorials and examples. Quote Link to comment Share on other sites More sharing options...
clanstyles Posted November 23, 2007 Share Posted November 23, 2007 I just told you.. I do it for my site this way it saves for 30 days. $cookieinfo = serialize(array('user_id' => $row['id'], 'accesskey' => $key)); Something like that and save $cookieinfo as value. YOu get there "Access Key" AND userID If both are valid on account allow them to use that ifno. Quote Link to comment Share on other sites More sharing options...
ndondo Posted November 23, 2007 Author Share Posted November 23, 2007 I am not very clear on one area ... with cookie , isn't user must login for the very first time? and if the cookie gets deleted, it may require them to login again? Sorry if I ask stupid question.. Thanks again for all the replies guys Quote Link to comment Share on other sites More sharing options...
revraz Posted November 23, 2007 Share Posted November 23, 2007 Well you have to set the cookie someway, and logging in for the first time would be a good one. And yes, if the delete the cookie, then it has to be set again. I am not very clear on one area ... with cookie , isn't user must login for the very first time? and if the cookie gets deleted, it may require them to login again? Sorry if I ask stupid question.. Thanks again for all the replies guys Quote Link to comment Share on other sites More sharing options...
wsantos Posted November 23, 2007 Share Posted November 23, 2007 Try getting the IP. Have them feed you the IP then hardcode it....LOL Quote Link to comment Share on other sites More sharing options...
ndondo Posted November 23, 2007 Author Share Posted November 23, 2007 Thanks, One more question. To login for the very first time is there a way to logging in using some script? meaning I have the username and password and I want to automate the logging in process Any advice? Well you have to set the cookie someway, and logging in for the first time would be a good one. And yes, if the delete the cookie, then it has to be set again. I am not very clear on one area ... with cookie , isn't user must login for the very first time? and if the cookie gets deleted, it may require them to login again? Sorry if I ask stupid question.. Thanks again for all the replies guys Quote Link to comment Share on other sites More sharing options...
trq Posted November 24, 2007 Share Posted November 24, 2007 You use a login to identify your users. Automating it would defeat the purpose. If your users are too stupid to be able to login to a website, they need more help than any support website could provide. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 24, 2007 Share Posted November 24, 2007 Automating a login would allow ANYONE seated at that computer to utilize the authorization. This includes public computers (librarys, internet cafes, etc.). If you use a cookie, set a timer in it that can expire. You really don't want to do what you're asking, without appropriate restrictions, otherwise as Thorpe points out, why require a login to begin with? PhREEEk Quote Link to comment Share on other sites More sharing options...
ndondo Posted December 6, 2007 Author Share Posted December 6, 2007 the reason is because we have a Visual basic program that will only be on the customer's computer and not in library or school computer we would like to limit this website to the public view, to eliminate the ideas that we have in our visual basic program to our competitor is there other ways beside cookies? how bout a script that will fetch the user and password to the PHP website? is that possible? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 6, 2007 Share Posted December 6, 2007 Still doesn't explain why they just can't log in. I know if it didn't ask me to log in, I would wonder how secure it really was. Quote Link to comment Share on other sites More sharing options...
ndondo Posted February 14, 2008 Author Share Posted February 14, 2008 I don't want the user to have an extra login and password because we have login and password in place already for starting a VB program... I just need a solution so that only user with my exe can see the website. I really hope some one could give me a solution? The easiest I could think of is to fetch the user and password (fixed and general login ) from the exe program to the PHP webpage... but even that I don't know how I can do it .. Thank you, Quote Link to comment Share on other sites More sharing options...
ndondo Posted February 14, 2008 Author Share Posted February 14, 2008 Sorry everyone, I don't mean to sound irritating or asking to much I was just wondering if anyone could give me ideas how I can implement our goal? thank you Quote Link to comment 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.