Is there any way to do this in PHP (or with a combination of JS)?


Kavoir.com

Recommended Posts

There's a login form on page A: http://www.example.com/A.html

The 'action' attribute of which is: action="/B.html"

So when someone logs in with the form on A.html, the data will be submitted to / visitor redirected to B.html.

Now what I want is: there's an on /C.html, framing B.html, is there any way so that when someone logs in with the form on A.html, the visitor is redirected to C.html and the login details is submitted to B.html that's framed on C.html in the ? So after the person logs in from A.html, he arrives at C.html with the actual CP dashboard framed in an

I have absolutely no clue in achieving this. Maybe the form will be submitted to C.html first and C.html submits the login details to B.html (framed in C.html) via JavaScript? How?

Link to comment
Share on other sites

You could use the PHP session variables to do it, ie. when the form is submitted to page C, it starts a session and saves the values. When page B is loaded, it can read those values from the users PHP session and authenticate.

The easier way to to it is pass the details straight to page B and let it do the login, using a piece of javascript on page B you can check to see if a frame is present, and if not, redirect. As the user should already have a session at this point, it should work fine.

Link to comment
Share on other sites

  • 4 weeks later...
You could use the PHP session variables to do it, ie. when the form is submitted to page C, it starts a session and saves the values. When page B is loaded, it can read those values from the users PHP session and authenticate.

The easier way to to it is pass the details straight to page B and let it do the login, using a piece of javascript on page B you can check to see if a frame is present, and if not, redirect. As the user should already have a session at this point, it should work fine.

Good idea! Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...