thunderbird22 Posted December 6, 2011 Share Posted December 6, 2011 Hi guys. What I want to create is really complicated. Well I have a login system that works with post on an external website. I have my own website, but they do not give me access to the database for security reasons, therefore I have to use their login system to verify my users. What their website does is that it has a post, with username and password. The POST website is lets say "https://www.example.com/login". If login is achieved (i.e. username and password are correct), it will redirect me to "https://www.example.com/login/success" else it will redirect me to "https://www.example.com/login/retry". So I want a PHP script that will do that post, and then according to the redirected website address it will return me TRUE for success, FALSE for not successful login. Any idea?? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/252544-login-using-external-side-login-system/ Share on other sites More sharing options...
tomfmason Posted December 6, 2011 Share Posted December 6, 2011 You should have a look at curl and more specifically curl_setopt. It looks like you will need to use the following options: CURLOPT_HEADER(to get the headers),CURLOPT_NOBODY(because you don't need the actual content), and CURLOPT_FOLLOWLOCATION(set to 0 because you don't need to follow the redirect). You can then inspect the response headers for the url you are being redirected to. Quote Link to comment https://forums.phpfreaks.com/topic/252544-login-using-external-side-login-system/#findComment-1294780 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.