473,394 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

posting info to a remote server

I have a page that processes a request from affiliates, the form processed the info and writes it to our database.

How can I tell the affiliate if the process was successful or not?

Is there something I could write at the end of the process for them to collect?
Apr 15 '08 #1
8 1548
DrBunchman
979 Expert 512MB
Hi Gareth,

There are many ways you can communicate with a third party via an automated process. Possibilites include:
  1. Sending an e-mail
  2. Sending data via ftp
  3. Submitting a form to a webpage of the affiliates
Do any of these sound like they may be suitable?

Dr B
Apr 16 '08 #2
Thanks Dr B

this is the scenario:

I have a form processor on our server that received the info and then processes it into our database. The affiliates post the info to us from their websites as follows:

Expand|Select|Wrap|Line Numbers
  1. DataToSend = "instruct=instruct&quotationnumber="&quotationnumber&"&partnerid="&partnerid
  2.  
  3. dim xmlhttp 
  4. set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
  5. xmlhttp.Open "POST","http://www.myserver.co.uk/xmlfeed/instruct.asp",false
  6. xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  7. xmlhttp.send DataToSend        'send data in the form of a query string
  8. Set xmlhttp = nothing
Once this task is completed their page continues to run as normal, but I want to send something back to say if it was successful or not.

So I am looking for maybe another line of code after processing the form that they can read to verify the process has been completed.
Apr 17 '08 #3
DrBunchman
979 Expert 512MB
Have you considered posting some data back in the same way as they have sent it?
Apr 17 '08 #4
Thanks Dr B

Tried a few things but modified the code to:

Expand|Select|Wrap|Line Numbers
  1.  dim xmlhttp 
  2. set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
  3. xmlhttp.Open "POST","http://www.website.co.uk/xmlfeed/instruct.asp",false
  4. xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  5. xmlhttp.send DataToSend    
  6. status = xmlhttp.status 
  7. if err.number <> 0 or status <> 200 then 
  8. if status = 404 then 
  9.             post_instruction="error_404" 
  10. elseif status >= 401 and status < 402 then 
  11.             post_instruction="error_401" 
  12. elseif status >= 500 and status <= 600 then 
  13.             post_instruction="error_500" 
  14. else 
  15.             post_instruction="error" 
  16. end if 
  17. else
  18.     post_instruction="completed" 
  19. end if
  20.     End If
  21. Set xmlhttp = nothing
  22.  
This then returns an error if the form failed. All sorted now.
Apr 17 '08 #5
DrBunchman
979 Expert 512MB
OKay Gareth, glad you got it sorted out.
Apr 18 '08 #6
Just spotted another problem, the information being posted is:

e.g.

Mr Gareth Harvey

but is getting written to the database as:

MrGarethHarvey

It's stripping out all the spaces? Don't know why
Apr 18 '08 #7
DrBunchman
979 Expert 512MB
Do you mean the data that you are receiving?

There's probably two places where the spaces are being removed: whilst being passed to your page or while being passed into your database update.

Can you test the recieved data (i.e. response.write it to the page) after it's been received initally and do the same just prior to it being passed into your update statement.

Hopefully you should be able to see where the spaces have been removed.

Dr B
Apr 18 '08 #8
The infor is being cleaned prior to sending, so a simple replace " ","+" solved the problem.
Apr 23 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: John Dalberg | last post by:
Hello I have a login form on a page that should post the data to a non Windows server and upon successful authentication, the browser needs to show the secodn url. I did the form post, got...
10
by: DaveFash | last post by:
Posting variables from an HTML FORM, via the Request.Form function on the receiving ASP page is great. But how can you POST a Form variable to an ASP page -- without a human pushing a Submit...
6
by: rh | last post by:
I am not able to send email using SmtpMail.Send. I imagine that it is a configuration issue. I see that the emails that I attempt to send are in the Mailroot/Queue folder but they never actually...
6
by: Alan Silver | last post by:
Hello, I have a page where users can alter the contents of a shopping basket. Once they are happy with the contents, they click a "checkout" button and are taken to the checkout page. What...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
12
by: smerf | last post by:
I have searched high and low (and even in some places I'd like to forget I ever saw) for the information that will tell me exactly how the Nat2Nat server for UltraVNC works (not just a vague...
2
by: Ultrak The DBA | last post by:
I would like to connect to a remote server, which I have already catalogued, and get the os and db2level information. I just realized that even though I connect to the other server my '!hostname'...
1
by: Robert Dufour | last post by:
Requirements are as follows. 1- There is a server application running named srvrApp. When an event occurs in the srvrAPP on the server, say InfoRcvd occurs, it must send information to a Winform...
11
by: Robin S. | last post by:
I've used phpinfo() to confirm settings for mySQL on our host server, and it's not returning accurate info. phpinfo() returns a mySQL client API version of 3.23.54 (uselss for me), where as a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.