Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/252544-login-using-external-side-login-system/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.