tags:

views:

37

answers:

1

Hi Everyone!

I need to call via Ajax a routine on my PHP server from my clients site on his server. If my client has PHP, I have a short PHP script used to call a PHP from one server to another and avoid cross-scripting issues using CURL:

<?php

$q=$_GET["q"];

$q=str_replace(" ","^",$q);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://myserver.com/search2A.php?q=".$q);

curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);

curl_close($ch);

?>

The problem are the clients with ASP sites, so this routine won't work and I have No idea how this would translate in ASP, so ASP does not run into a cross-browser issue. Any help, please?!!!

Regards,

Michael

A: 

This should work:

<%

Dim q
q = Replace(Request("q")," ","^")

Dim httpObject
Set httpObject = Server.CreateObject("WinHttp.WinHttpRequest.5.1")

httpObject.Open "GET", "http://myserver.com/search2A.php?q=" & q
httpObject.Send

Set httpObject = Nothing

%>
thirtydot
Worked great! Thanks for your help!!!
Michael