FUDforum - خوراک RDF
http://fudforum.org/forum/index.php
Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180650&th=122972#msg_180650
I'm not a php programmer but my customer is using Word Press and WooCommerce (I assume php is used to do the process etc.) for their order processing). What we would like to do is to add a function to pass the order data / form data to
a remote script so that the remote script can capture the form data as well, no need to get anything back to the caller (the current form processor).
Is it doable with php?
Thanks.]]>lichunshen842013-03-08T01:29:34-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180651&th=122972#msg_180651
lichunshen84@gmail.com wrote:
> Hi,
>
> I'm not a php programmer but my customer is using Word Press and
> WooCommerce (I assume php is used to do the process etc.) for their
> order processing). What we would like to do is to add a function to
> pass the order data / form data to a remote script so that the remote
> script can capture the form data as well, no need to get anything back
> to the caller (the current form processor).
>
> Is it doable with php?
Almost certainly yes. PHP support establishing network connections by
many means.
--
186,000 Miles per Second. It's not just a good idea. IT'S THE LAW.]]>Peter H. Coffin2013-03-08T02:10:23-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180653&th=122972#msg_180653
> On Thu, 7 Mar 2013 17:29:34 -0800 (PST), lichunshen84@gmail.com wrote:
>
>
>
>> Hi,
>
>>
>
>> I'm not a php programmer but my customer is using Word Press and
>
>> WooCommerce (I assume php is used to do the process etc.) for their
>
>> order processing). What we would like to do is to add a function to
>
>> pass the order data / form data to a remote script so that the remote
>
>> script can capture the form data as well, no need to get anything back
>
>> to the caller (the current form processor).
>
>>
>
>> Is it doable with php?
>
>
>
> Almost certainly yes. PHP support establishing network connections by
>
> many means.
>
Could you elaborate a bit? Even better, some sample code. Thanks.]]>lichunshen842013-03-08T02:39:27-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180654&th=122972#msg_180654
lichunshen84@gmail.com wrote:
> On Thursday, March 7, 2013 9:10:23 PM UTC-5, Peter H. Coffin wrote:
>> On Thu, 7 Mar 2013 17:29:34 -0800 (PST), lichunshen84@gmail.com wrote:
>>
>>
>>
>>> Hi,
>>
>>>
>>
>>> I'm not a php programmer but my customer is using Word Press and
>>
>>> WooCommerce (I assume php is used to do the process etc.) for their
>>
>>> order processing). What we would like to do is to add a function to
>>
>>> pass the order data / form data to a remote script so that the remote
>>
>>> script can capture the form data as well, no need to get anything back
>>
>>> to the caller (the current form processor).
>>
>>>
>>
>>> Is it doable with php?
>>
>>
>>
>> Almost certainly yes. PHP support establishing network connections by
>>
>> many means.
>>
>
> Could you elaborate a bit? Even better, some sample code. Thanks.
>
Sure whats the commission?]]>Scott Johnson2013-03-08T02:54:30-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180655&th=122972#msg_180655
> On 3/7/2013 6:39 PM, lichunshen84@gmail.com wrote:
>
>> On Thursday, March 7, 2013 9:10:23 PM UTC-5, Peter H. Coffin wrote:
>
>>> On Thu, 7 Mar 2013 17:29:34 -0800 (PST), lichunshen84@gmail.com wrote:
>
>>>
>
>>>
>
>>>
>
>>>> Hi,
>
>>>
>
>>>>
>
>>>
>
>>>> I'm not a php programmer but my customer is using Word Press and
>
>>>
>
>>>> WooCommerce (I assume php is used to do the process etc.) for their
>
>>>
>
>>>> order processing). What we would like to do is to add a function to
>
>>>
>
>>>> pass the order data / form data to a remote script so that the remote
>
>>>
>
>>>> script can capture the form data as well, no need to get anything back
>
>>>
>
>>>> to the caller (the current form processor).
>
>>>
>
>>>>
>
>>>
>
>>>> Is it doable with php?
>
>>>
>
>>>
>
>>>
>
>>> Almost certainly yes. PHP support establishing network connections by
>
>>>
>
>>> many means.
>
>>>
>
>>
>
>> Could you elaborate a bit? Even better, some sample code. Thanks.
>
>>
>
>
>
> Sure whats the commission?
First time, to hear about commission on such a forum. In the meantime, a favor rendered a favor will be returned when an opportunity arises.]]>lichunshen842013-03-08T03:00:32-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180657&th=122972#msg_180657
lichunshen84@gmail.com wrote:
> On Thursday, March 7, 2013 9:54:30 PM UTC-5, Scott Johnson wrote:
>> On 3/7/2013 6:39 PM, lichunshen84@gmail.com wrote:
>>
>>> On Thursday, March 7, 2013 9:10:23 PM UTC-5, Peter H. Coffin wrote:
>>
>>>> On Thu, 7 Mar 2013 17:29:34 -0800 (PST), lichunshen84@gmail.com wrote:
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> > Hi,
>>
>>>>
>>
>>>> >
>>
>>>>
>>
>>>> > I'm not a php programmer but my customer is using Word Press and
>>
>>>>
>>
>>>> > WooCommerce (I assume php is used to do the process etc.) for their
>>
>>>>
>>
>>>> > order processing). What we would like to do is to add a function to
>>
>>>>
>>
>>>> > pass the order data / form data to a remote script so that the remote
>>
>>>>
>>
>>>> > script can capture the form data as well, no need to get anything back
>>
>>>>
>>
>>>> > to the caller (the current form processor).
>>
>>>>
>>
>>>> >
>>
>>>>
>>
>>>> > Is it doable with php?
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> Almost certainly yes. PHP support establishing network connections by
>>
>>>>
>>
>>>> many means.
>>
>>>>
>>
>>>
>>
>>> Could you elaborate a bit? Even better, some sample code. Thanks.
>>
>>>
>>
>>
>>
>> Sure whats the commission?
>
> First time, to hear about commission on such a forum. In the meantime, a favor rendered a favor will be returned when an opportunity arises.
>
>
In this newsgroup (this is usenet - NOT a forum), volunteers are helping
each other. We're doing this on our own time. We'll help you with your
code - but if you want someone to just write it for you, hire a
consultant.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
==================]]>Jerry Stuckle2013-03-08T03:59:01-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180663&th=122972#msg_180663
lichunshen84@gmail.com:
> On Thursday, March 7, 2013 9:10:23 PM UTC-5, Peter H. Coffin wrote:
>> On Thu, 7 Mar 2013 17:29:34 -0800 (PST), lichunshen84@gmail.com wrote:
>>
>>
>>
>>> Hi,
>>
>>>
>>
>>> I'm not a php programmer but my customer is using Word Press and
>>
>>> WooCommerce (I assume php is used to do the process etc.) for their
>>
>>> order processing). What we would like to do is to add a function to
>>
>>> pass the order data / form data to a remote script so that the remote
>>
>>> script can capture the form data as well, no need to get anything back
>>
>>> to the caller (the current form processor).
>>
>>>
>>
>>> Is it doable with php?
>>
>>
>>
>> Almost certainly yes. PHP support establishing network connections by
>>
>> many means.
>>
>
> Could you elaborate a bit? Even better, some sample code. Thanks.
>
Introduction
PHP supports libcurl, a library created by Daniel Stenberg, that allows you to
connect and communicate to many different types of servers with many different types
of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict,
file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP
PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based
upload, proxies, cookies, and user+password authentication.
These functions have been added in PHP 4.0.2.
/Str.]]>M. Strobel2013-03-08T09:12:25-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180679&th=122972#msg_180679
<?php
// CONFIRM THAT POST DATA IS PRESENT
if (@!empty($_POST)) {
// DEFINE REMOTE URL TO POST TO
define("REMOTE_POSTURL", "http://second.site.com/scripts/example.php");
// GRAB AND FORMAT INCOMING POST DATA
foreach ($_POST as $pKey=>$pVal) { @$postData .= "$pKey=$pVal&"; }
// REMOVE TRAILING AMPERSANDS
$postData = rtrim($postData, "&");
// CREATE/INITIALIZE CURL
$ch = curl_init(REMOTE_POSTURL);
// SET VARIOUS OPTIONS
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
// FINALLY, EXECUTE REQUEST AND CLOSE HANDLE
curl_exec($ch);
curl_close($ch);
}
?>
On Friday, March 8, 2013 3:12:25 AM UTC-6, M. Strobel wrote:
> Am 08.03.2013 03:39, schrieb lichunshen84@gmail.com:
>
>> On Thursday, March 7, 2013 9:10:23 PM UTC-5, Peter H. Coffin wrote:
>
>>> On Thu, 7 Mar 2013 17:29:34 -0800 (PST), lichunshen84@gmail.com wrote:
>
>>>
>
>>>
>
>>>
>
>>>> Hi,
>
>>>
>
>>>>
>
>>>
>
>>>> I'm not a php programmer but my customer is using Word Press and
>
>>>
>
>>>> WooCommerce (I assume php is used to do the process etc.) for their
>
>>>
>
>>>> order processing). What we would like to do is to add a function to
>
>>>
>
>>>> pass the order data / form data to a remote script so that the remote
>
>>>
>
>>>> script can capture the form data as well, no need to get anything back
>
>>>
>
>>>> to the caller (the current form processor).
>
>>>
>
>>>>
>
>>>
>
>>>> Is it doable with php?
>
>>>
>
>>>
>
>>>
>
>>> Almost certainly yes. PHP support establishing network connections by
>
>>>
>
>>> many means.
>
>>>
>
>>
>
>> Could you elaborate a bit? Even better, some sample code. Thanks.
>
>>
>
> Introduction
>
>
>
> PHP supports libcurl, a library created by Daniel Stenberg, that allows you to
>
> connect and communicate to many different types of servers with many different types
>
> of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict,
>
> file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP
>
> PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based
>
> upload, proxies, cookies, and user+password authentication.
>
>
>
> These functions have been added in PHP 4.0.2.
>
>
>
> /Str.]]>iarethebest2013-03-09T16:29:42-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180680&th=122972#msg_180680
> Strobel is correct, cURL is likely the way to go. Typically, the ideal way to go about it would be to modify the page that the form posts to (e.g. <form method="post" action="XXX"> - where XXX is what you want to pay attention to). For example, at the top of that script, you'd add something to the effect of:
>
<snip code>
What a bunch of crap code. I'd be embarrassed to even admit that was my
code. But then that's the type of "quality" I expect from Google Groupies.
And it doesn't necessarily do what the OP wants - in fact, it probably
does not; the OP was very unclear about his requirements.
P.S. Please don't top post.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
==================]]>Jerry Stuckle2013-03-09T20:28:18-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180686&th=122972#msg_180686
Your inability to understand his requirements is _your_ burden to carry, it is not mine and it is not his.
Reminder: if there were anything wrong with the code, be it syntax, concept, implementation, etc: you'd have specifically pointed such out (because apparently, your ego is the only important element in this discussion). But, as we can all see, you didn't and it's crystal clear why.
Lastly, the Google Groups comment only serves to expose your own ignorance. As if the medium used for communication in some way dictates anything regarding content/quality. Usually when someone's condescending, it's because they at least have _somewhat_ of a reason to be. In this case, the exact opposite is true. There was absolutely no substance to _any_ part of that _entire_ post.
On Saturday, March 9, 2013 2:28:18 PM UTC-6, Jerry Stuckle wrote:
> On 3/9/2013 11:29 AM, padam wrote:
>
>> Strobel is correct, cURL is likely the way to go. Typically, the ideal way to go about it would be to modify the page that the form posts to (e.g. <form method="post" action="XXX"> - where XXX is what you want to pay attention to). For example, at the top of that script, you'd add something to the effect of:
>
>>
>
>
>
> <snip code>
>
>
>
> What a bunch of crap code. I'd be embarrassed to even admit that was my
>
> code. But then that's the type of "quality" I expect from Google Groupies.
>
>
>
> And it doesn't necessarily do what the OP wants - in fact, it probably
>
> does not; the OP was very unclear about his requirements.
>
>
>
> P.S. Please don't top post.
>
>
>
>
>
> --
>
> ==================
>
> Remove the "x" from my email address
>
> Jerry Stuckle
>
> JDS Computer Training Corp.
>
> jstucklex@attglobal.net
>
> ==================]]>iarethebest2013-03-10T05:07:55-00:00Re: Does PHP have a way to pass form data to a remote script?
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=180688&th=122972#msg_180688
> Nice blanket statement. The code is clear, concise and works effectively well for the situation described in the original post.
>
> Your inability to understand his requirements is _your_ burden to carry, it is not mine and it is not his.
>
> Reminder: if there were anything wrong with the code, be it syntax, concept, implementation, etc: you'd have specifically pointed such out (because apparently, your ego is the only important element in this discussion). But, as we can all see, you didn't and it's crystal clear why.
>
> Lastly, the Google Groups comment only serves to expose your own ignorance. As if the medium used for communication in some way dictates anything regarding content/quality. Usually when someone's condescending, it's because they at least have _somewhat_ of a reason to be. In this case, the exact opposite is true. There was absolutely no substance to _any_ part of that _entire_ post.
>
Exactly what I would expect from someone who refuses to follow newsgroup
guidelines.
To start - the code is crap, with minimal error checking and suppression
of potential errors. It assumes you are posting data to a remote URL,
and the source of that data is a POST, that all the data posted to the
current page (and nothing else) is to be posted to the remote site. I
could go on, but I won't. It does NOT solve the user's problem - but
you're too stoopid to understand that. It's probably something you
copied from some site on the internet, but don't even understand what
you posted.
And the Google Groups comment is right on, as you post once again
proved. The members of this and other newsgroups have seen the results
provided by Google Groupies. They are almost universally bad - but
usually not nearly as bad as the crap you posted.
I see why you use a 'nym. I'd be embarrassed to post this crap under my
real name, also.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
==================]]>Jerry Stuckle2013-03-10T13:23:27-00:00