Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fetch page and set variables 1

Status
Not open for further replies.

mp89

Programmer
Sep 17, 2004
35
GB
I want to fetch a page and set variables without doing a redirect to that page. e.g. in PHP :

$url = '
$req =& new HTTP_Request();
$req->setURL($url);
$req->addQueryString('cmd', 'send');
$req->addQueryString('from', $from);
$req->addQueryString('number', $number);
$req->addQueryString('message', $message);
$req->addQueryString('messageid', $msg_id);
$req->sendRequest();
$res = $req->getResponseBody();

Is this possible in ASP?


Cheers,

Mike
 
Genimuse,

I've looked through the tutorial, but my code doesn't work. Can you see what is wrong with it?

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<%
Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

'Notice the two changes in the next two lines:
xml.Open "GET", " False
xml.Send "cmd=send&from=CALLUM&message=mess&number=447817010766&messageid=64000"

Response.Write xml.responseText

Set xml = Nothing
%>
</body>
</html>


Cheers,

Mike
 
What kind of error are you getting?

You should probably put some spare div tags or something around the Response.Write just to make it stand out some. Occaisonally you will get error pages and it is hard to tell if it is the local or remote script that is cholking p (although in your cxase, one would be a 500-100 page and one would be a php error page, but anyways).

Aso, you could print the status property ofyour object and that should return the numeric status for the retrieval (ie, 200, 401, 403, 404, 500, etc)

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top