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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML POST via code

Status
Not open for further replies.

M8KWR1

IS-IT--Management
Dec 8, 2008
20
0
0
GB
Hi,

I have got the following code, which all works fine, just so you know it queries paypal...

Code:
            System.Web.HttpContext.Current.Response.Clear()
            System.Web.HttpContext.Current.Response.Write("<html><head>")
            System.Web.HttpContext.Current.Response.Write(String.Format("</head><body onload=""document.{0}.submit()"">", FormName))
            System.Web.HttpContext.Current.Response.Write(String.Format("<form name=""{0}"" method=""{1}"" action=""{2}"" >", FormName, Method, Url))

            Dim i As Integer = 0

            Do While i < Inputs.Keys.Count

                System.Web.HttpContext.Current.Response.Write(String.Format("<input name=""{0}"" type=""hidden"" value=""{1}"">", Inputs.Keys(i), Inputs(Inputs.Keys(i))))
                i += 1
            Loop

            System.Web.HttpContext.Current.Response.Write("</form>")
            System.Web.HttpContext.Current.Response.Write("</body></html>")
            System.Web.HttpContext.Current.Response.End()

I am trying to make it secure as possible without using the api calls, as i am no good at that.

I have tested it, and i can not see the fields it is writing to the webpages when i can back, or try and break the code half way through.

I am really just want confirmation that this is ok to use, and if not is there a way that it can post to a url and not have to do a write command.

Many thanks
 
I was tasked with communicating via paypal to do a secure transaction over the internet a year ago. What I found was it wasn't easy. :)

Having said that I saved hours and hours of work by purchasing dotnet charge


It saved me many hours of tearing out my hair, and it saved my client $$$ by not involving my time. - only 100 for the package and works easily with many many processors.

Now, I just go https and pass the info into the methods for working with paypal. (the more research i put into pay pal and dotnet, the more I realized that it was better to purchase a prebuilt component.)



Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top