The goal is to populate form[id=thisAwesomeRemoteForm][action=#]on a remote website. To fill in just one field ( input[name=awesomeField]), and then you need to send a form. As a final requirement, the user needs to redirect from my website to this remote website, as if he had submitted a form on a remote website.
In short, I need the user to be able to click on my link, get PHP to do the job, and redirect to this remote website, as if it filled out and submitted the form on the remote website. I should not force the user to fill out the remote form myself.
Code so far:
use Goutte\Client;
public function gotoAction($data)
{
$client = new Client();
$crawler = $client->request('GET', self::MY_URL);
$form = $crawler->filter('form[id=thisAwesomeRemoteForm]')->form();
$form->setValues(array('awesomeField' => $data));
$crawler = $client->submit($form);
return $this->redirect($form->getUri());
}
URL, form , form . .
(, , -, JavaScript - ), - ?