1

Let's say I have a text <input>.

Is there any way to:

  • send the text in the input to a separate website with a login screen
  • fill in the login details

OR

  • fill in a search box on the site
  • submit the search
  • get search results

Assuming this is possible, can I retrieve the result? Can I display the results somehow in an <iframe> or something like that?

Jonathan Lam
  • 16,831
  • 17
  • 68
  • 94
Martin O Leary
  • 633
  • 2
  • 10
  • 29

1 Answers1

1

For the first part, if you know which form the data goes to and what data (GET or POST variables), then you might be able to send data directly to that form via PHP. AFAIK, I don't think this is possible because of anti-cross-server safety measures except with certain libraries.

EDIT

  • With JS/jQuery and AJAX, this is not possible because of the "Same Origin Policy".
  • In PHP, you can do this, using cURL.

For the second part, the "results" (i.e., a search page, or an account/logged in/welcome page) should be a webpage that you can easily put in an <iframe> as normal. If you don't know how to use an <iframe>:

<iframe src="PAGE_URL">Your browser doesn't support iframe.</iframe>
Jonathan Lam
  • 16,831
  • 17
  • 68
  • 94
  • Thanks Jonathan. I am OK with using iframes so hopefully when I learn about the cURL a bit more I can work it out. Any working examples of cURL in action? for a beginner that I can dissect and understand – Martin O Leary Nov 07 '15 at 21:11