Re: Re: PHP integration with ASP
| From: | Info@Best-IT | Date: | Mon, 26 Jan 2004 02:47:37 +0000 |
| Subject: | Re: Re: PHP integration with ASP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175711@lists.php.net to get a copy of this message | ||
This is exactly what I needed. Thanks a million!!!
/T
on 1/25/04 18:24, Ben Ramsey at br@benandliz.com wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Since the action of your form is the ASP script, it will always take
> your user to the ASP script and not return results to the PHP
> application, which I think it what you want to do, if I am not mistaken.
>
> I found a link in the manual (http://us4.php.net/http) to someone's
> function for peforming posts to an external site and retrieving the
> returned data. In this way, you could set the action of your form to
> another PHP script on the same server that would then use this http_post
> function to post to the external ASP script. The ASP script's results
> would be sent back to your PHP script and returned by the http_post
> function for you to use. I hope this is what you're looking for.
>
> The function is located at:
> http://nf.wh3rd.net/projects/http.inc/
>
>
> Info@Best-It wrote:
> | I am working on an integration between my PHP site and an ASP site
> with XML.
> | The basic flow is this: I generate a request by placing XML into the
> value
> | portion of an input tag called ³REQUEST² the action is the url of the
> remote
> | ASP server which receives the request. It then returns a form with
> the same
> | ³REQUEST² input tag with the XML as the value. My problem is getting the
> | XML that is posted to the form. The confusing thing is that once I
> receive
> | the XML data I am no longer in my site. The header information changes to
> | the URL that sent the data.
> |
> | I am not sure how to capture the data that is returned by the server.
> I have
> | a procedure that puts XML data into my db from file. But I'm not sure how
> | to get this result into a file.
> |
> | The ASP example that I am changing to PHP is Request.Form("Results")
> | basically it gets the form's Results variable... How can you do that
> in PHP
> | when nothing has been sent to the server?? Any insight would be very
> | helpful...
> |
> | My code is below:
> |
> | Code that generates the request:
> |
> | $doc = domxml_new_doc('1.0');
> | $top_element = $doc->add_child($doc->create_element('ExchangeRequest'));
> |
> | $login_data_node =
> | $top_element->add_child($doc->create_element('LoginData'));
> | $login_data_node->set_attribute("UserName", "uname");
> | $login_data_node->set_attribute("Password", "pass");
> |
> | $request_node = $top_element->add_child($doc->create_element('Request'));
> | $request_node->set_attribute("Type", "RetrieveNewSearches");
> |
> | //echo "<pre>Comment: "; print(htmlentities($doc->html_dump_mem(true)));
> | echo "</pre>"; die;
> |
> | $xml = $doc->html_dump_mem();
> | $ns = strtr($xml, "\"", "'");
> |
> | //echo "<pre>Comment: "; print($ns); echo "</pre>"; die;
> |
> | $html = "<html>
> | <body>
> | <form name=\"Exchange\" method=\"POST\"
> | action=\"https://remoteaspserver/action.asp\">
> | <input type=\"text\" size=150 name=\"Request\"
> | value=\"$ns\"></input>
> | <br><br>
> | <input type=\"submit\"
> value=\"Submit\"></input>
> | </form>
> | </body>
> | </html>";
> |
> | print($html);
> |
> |
> | Code received by server:
> |
> | <html>
> | <body>
> | <input type="text" name="Results" value="<?xml
> version='1.0'?>
> | <Results RequestSuccessful='True'>
> | <Searches NumberIncluded='1'>
> | <Search Type='data'>
> | <ID>1</ID>
> | <Comments/>
> | </Search>
> | </Searches>
> | </Results>
> | "></input>
> | </body>
> | </html>
> |
> |
> | Thanks for your help!
> | /Tim Best
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (MingW32)
> Comment: Using GnuPG with Thunderbird -
> http://enigmail.mozdev.org
>
> iD8DBQFAFF4/IcIs3CP5DxwRAsQDAJ9qYdQ5l4B/e0lurUVb49GD0m42lwCeOUjO
> qBoYMiC62Hf2VgwgLTWH2vg=
> =t6ej
> -----END PGP SIGNATURE-----