Forum Moderators: coopster

Message Too Old, No Replies

PHP Post to another URL

How to POST server-to-server in the background

         

dotme

10:20 pm on Dec 6, 2004 (gmt 0)

10+ Year Member



I am an asp programmer. I need to help a php programmer post data from his server to mine. His OS is linux.

If I were posting to his, I'd use MS XML object. Take data submitted by the browser, append needed values, use the XML object to post to another server, wait for response, then write response to the browser.

Is there an equivalent in PHP/Linux? Something that will allow server-to-server POSTs? Thanks in advance for the help.

baze22

11:23 pm on Dec 6, 2004 (gmt 0)

10+ Year Member




//init vars here. set $goURL to url to post to
print "<html><head>
<script>function ReLoad(){
document.FORM.submit();
}
</script></head>
<body OnLoad='ReLoad();'>
<form name='FORM' action='$goURL' method='post'>
<input type='hidden' name='MonthA' value='$MonthA'>
<input type='hidden' name='DayA' value='$DayA'>
<input type='hidden' name='YearA' value='$YearA'>
//blah, blah move vars...
<input type='hidden' name='$listtype' value='$listtype'>
<input type='hidden' name='tab' value='$listtype'>
<INPUT type=hidden value=Y name=list>
<INPUT type=hidden value=find_dates name=act>
$idline
</form>
</body>
</html>";

I had a similar dilema. This is what I came up with for my situation. I couldn't find a cleaner solution. Anotehr solution I "thought" I remember reading about was the CURL functions in PHP - you might check those out too, I'm not familiar with CURL so I'm not sure.

baze

willybfriendly

11:55 pm on Dec 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does this thread help?

[webmasterworld.com...]

WBF

baze22

12:47 am on Dec 7, 2004 (gmt 0)

10+ Year Member



Much better solution than my kludge...;)

thx,

baze

dotme

1:57 pm on Dec 7, 2004 (gmt 0)

10+ Year Member



Thanks everyone! Awesome.