6

I don't know how to send datas (in POST) to another site than mine with Laravel Form.

I tried a (GET) form :

{!! Form::open(array('url' => 'http://other.domain.com')) !!}
    <input type="text" name="test" value="something" />
    <button type="submit">Submit</button>
{!! Form::close() !!}

It stays in : mydomain:8000/mypage?test=something

But I want this to be http://other.domain.com?test=something

Any clue?

2 Answers2

0

I think what you're looking for is

{!! Form::open(array('action' => 'http://other.domain.com')) !!}
Eyeball
  • 11
  • 1
  • seems like Action App\Http\Controllers\http://other.domain.com/salesprocess/reservationFormAction.to not defined. (View: /home/vagrant/Code/project/resources/views/common/reservation.blade.php) (View: /home/vagrant/Code/project/resources/views/common/reservation.blade.php) (View: /home/vagrant/Code/project/resources/views/common/reservation.blade.php) – Adeline Mani-Rajan Sep 03 '15 at 08:40
  • After diving into the form generator code i found that you can use url, action or route as parameter. In your case url is the way to go (for external urls). Also, if you don't specify a method, POST is default. – Eyeball Sep 03 '15 at 08:55
  • Yes exactly what I done but still not working :( (Is that because I am working in local) – Adeline Mani-Rajan Sep 03 '15 at 09:00
  • I published online and no way... I've a hint maybe ... I am going for a redirect url I think... – Adeline Mani-Rajan Sep 03 '15 at 10:15
0

The problem that I had was 'HTML' :

<form>
 <form action='http://other.domain.com'>
   <input type="text" name="test" value="something" />
   <button type="submit">Submit</button>
 </form>
</form>

And the fact is that when you click on the submit button it takes the first form. Very weird.