views:

32

answers:

2

I need to POST data from inside a controller to a third party website and make sure they receive my website as the HTTP_REFERER. How can I do this?

A: 

There's no robust way to have the client browser post some data of its own accord with an appropriate HTTP referrer.

You will have to do it from the server, using curl or a similar library.

Victor Nicollet
He was talking about doing it from the server
pharalia
@pharalia : the "redirect" in the title made me suspect he wanted to tell the client to do it.
Victor Nicollet
+3  A: 

The Referer is sent as a header, simply:

$client = new Zend_Http_Client($uri);
$client->setHeaders('Referer', 'http://www.yourwebsite.com/');
$client->request(Zend_Http_Client::POST);
David Caunt
Awesome. I did not know that it was a header. Thanks!
Andrew