http - PHP POST with header() and Bad header problems -


I came to a dumb issue with sending headers to PHP. I have read on SO and other sites in about 45 minutes and I can not tell a valid reason for my problem.

I need to send a post request to another server and I'm using PHP header () function to set the value. I have sample code.

  $ server = 'http://fakedomain.com'; $ Server_path = '/'; $ Request = 'key = value & amp; Key2 = value2 '; Header ("post $ server_path http / 1.1"); Header ("host: $ server \ r \ n"); Header ("content-type: app / x-www-form-urlxode \ r \ n"); Header ("Content-Length:". Stellen ($ request). "\ R \ n"); Header ("Connection: Closed \ r \ n \ r \ n"); Header ($ request);  

I have selected several options but each of them results in the same error in my log file

  wrong format from script bad header = POST / HTTP / 1.1: php5.cgi  

I am an experienced PHP programmer that does not need to send HTTP post requests manually.

I want a code to redirect the browser, so I decided to use this method.

Am I correcting it?

Is there any other way that is standard and I just do not know about it?

header sends the header.

It seems that you want to make an request backwards.

So you probably want to use to request.

If you complete the reaction process, you want to send some kind of header to the user agent (browser), then the header () is appropriate.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -