Wrox Programmer Forums
|
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 4th, 2005, 03:16 AM
Registered User
 
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML Help please

I am a newbie in asp and having difficulty to understand the different between these 2 codes. Could someone please help?

== Process.asp ==
<%
.
.
.some more code
Function SendTransaction()
'If Request.Form("CC_Number") <> "" Then

sXmlAction = sXmlAction & "<Txn><PostUsername>" & Request.Form("Access") & "</PostUsername>"
sXmlAction = sXmlAction & "<PostPassword>" & Request.Form("Entry") & "</PostPassword>"
sXmlAction = sXmlAction & "<TxnType>" & Request.Form("TxnType") & "</TxnType>"
sXmlAction = sXmlAction & "<CardHolderName>" & Request.Form("CC_Name") & "</CardHolderName>"
sXmlAction = sXmlAction & "<CardNumber>" & Request.Form("CC_Number") & "</CardNumber>"
sXmlAction = sXmlAction & "<Amount>" & Request.Form("TotalAmount") & "</Amount>"
sXmlAction = sXmlAction & "<DateExpiry>" & ExpiryDate & "</DateExpiry>"
sXmlAction = sXmlAction & "<MerchantReference>" & Request.Form("MerchantRef") & "</MerchantReference>"
sXmlAction = sXmlAction & "<ReceiptEmail>" & Str_To & "</ReceiptEmail></Txn>"

Dim objXMLhttp
Set objXMLhttp = server.Createobject("MSXML2.XMLHTTP")

objXMLhttp.Open "POST", "https://www.someurl/pxpost.aspx" ,True
objXMLhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXMLhttp.send sXmlAction
'response.write objXMLhttp.responsetext

Set objXMLhttp = nothing
'End If
End Function

' Send Credit Card Transaction
Call SendTransaction()

.
.
.some more code
%>
== pxpost.asp ==
<%
'If Request.Form("Username") <> "" Then

sXmlAction = sXmlAction & "<Txn><PostUsername>" & Request.Form("Username") & "</PostUsername>"
sXmlAction = sXmlAction & "<PostPassword>" & Request.Form("Password") & "</PostPassword>"
sXmlAction = sXmlAction & "<TxnType>" & Request.Form("TxnType") & "</TxnType>"
sXmlAction = sXmlAction & "<CardHolderName>" & Request.Form("CardHolderName") & "</CardHolderName>"
sXmlAction = sXmlAction & "<CardNumber>" & Request.Form("CardNumber") & "</CardNumber>"
sXmlAction = sXmlAction & "<Amount>" & Request.Form("AmountInput") & "</Amount>"
sXmlAction = sXmlAction & "<DateExpiry>" & Request.Form("ExpiryDate") & "</DateExpiry>"
sXmlAction = sXmlAction & "<MerchantReference>" & Request.Form("MerchantRef") & "</MerchantReference>"
sXmlAction = sXmlAction & "<ReceiptEmail>" & Request.form("Email") & "</ReceiptEmail></Txn>"

Dim objXMLhttp
Set objXMLhttp = server.Createobject("MSXML2.XMLHTTP")

objXMLhttp.Open "POST", "https://www.someurl.com/pxpost.aspx" ,True
objXMLhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXMLhttp.send sXmlAction
'response.write objXMLhttp.responsetext

Set objXMLhttp = nothing
'End If
%>
<html>
<head></head>
<body>
<form action="pxpostsample.asp" method="post">
Username<input name="Username" value="Username"><br>
Username<input name="Password" value="Password"><br>
TxnType<input name="TxnType" value="Purchase"><br>
CardHolderName<input name="CardHolderName" value="test"><br>
CardNumber<input name="CardNumber" value="4111111111111111"><br>
AmountInput<input name="AmountInput" value="1.00"><br>
ExpiryDate<input name="ExpiryDate" value="0102"><br>
MerchantRef<input name="MerchantRef" value="post test"><br>
Email<input name="Email" value="email">
<input type="submit">
</form>
</body>
</html>


======

The pxpost.asp works by itself but when I put it into different file after submit using the process.asp the code does not seem to work anymore. Could someone help please.







Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server 2005 XML: FOR XML PATH -> cdata? stoves SQL Server 2005 1 July 8th, 2008 02:40 AM
Creating XML doc ; writing string(xml format) into KamalRaturi XML 5 May 28th, 2008 05:51 AM
VB.net, adding XML data to an existing XML file saikoboarder XML 11 April 17th, 2008 04:19 PM
xml invalid top level from ASP write XML(solution) g000we XML 0 August 9th, 2006 03:56 AM
DTS Package, XML task. Read XML file and store it Victoria SQL Server DTS 0 July 24th, 2006 02:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.