0

Page A is the parent. From page A, the user clicks on a link and a new page B opens. I do not own page B. Then there, there is some kind of registration form for the user to complete. I need to know in page A that the form on B is submitted correctly when it happens (inject JS?).

I will handle the JS to determine if the form is completed or not. What I'm asking if it is possible what I am looking for, to send back the info to page. I would do this using an iframe, all within the same page but I am getting mixed content errors as page B is in http (I need my page A to be in https).

1 Answers1

1

Normally this is not possible, but sometimes forms have some kind of callback, for instance forms from payment providers. They allow you to send your customer to their payment page, and they redirect them back to a callback page after the payment is done. Hopefully PageB supports such a thing, otherwise, you're in trouble.

One possible solution, if the form isn't very complex, and doesn't have much scripting, and doesn't require logon or other session or cookie related stuff, you might use file_get_contents or curl to get the form, modify it a little to post the changes to another script of yours, and then, from the server, post the form data to originating server. That way, you capture the entire form and everything the user submits is submitted through your server, giving you all the information you need.

Of course this is not easily possible with every form, so you'll have to try if it works for this one.

Community
  • 1
  • 1
GolezTrol
  • 114,394
  • 18
  • 182
  • 210
  • I don't really care about what the user enters in the form, just to know that it is completed succesfully. The form i really simple, similar to this one: http://passport.game321.com/api/lp/angels/N/lp21.php. I'm trying to setup a content locker that unlocks something in page A when the user registers through that link in page B. – Alejandro Fernández Oct 16 '15 at 22:01
  • Well, whether you're interested or not, that could be a solution. Otherwise cross site scripting restrictions won't allow you to inject js in the page in the iframe. – GolezTrol Oct 16 '15 at 22:20