Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 7:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Posting data from Opus 4 to an ASP page
PostPosted: November 16th, 2004, 9:45 pm 
Offline

Joined: November 16th, 2004, 9:40 pm
Posts: 19
I am trying to post data from opus to an ASP page, but for some reason the ASP page does not seem to recognise the variable passed to it. Also how do I then send the response back to opus. The manual only mentions CGI-Scripts. Is it possible in ASP?

Anyone have any ideas.

Thanks!!


For this message kenkofi has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 17th, 2004, 11:18 am 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

I assume that you have already set up a Post Web Data action (setting the publication as the Source) which sends the required variables and values to the .asp file.

This being the case, you simply need to use Request() functions to recieve the post data and store the values to variables in the script. For example, if the Post Web Data actions sends four variables named 'first_name', 'surname', 'age' and 'occupation', your ASP file would need to contain the following block of actions prior to any updating of the database:

Code:
first = request("first_name")
last = request("surname")
age = request("age")
addr = request("address")


You should now be able to use these 'first', 'last', 'age' and 'addr' variables within your database query.

To send data from ASP to the publication, you will need to use the Response.Write function. For example, to send the 'first', 'last', 'age' and 'addr' values of the current record back to the publication, you would use the following code:

Code:
Response.Write "first_name=" & Server.URLEncode(recordset("first")) & _
"&surname=" & Server.URLEncode(recordset("last")) & _
"&age=" & Server.URLEncode(recordset("age")) & _
"&address=" & Server.URLEncode(recordset("addr"))


where 'recordset' is the name of your database connection and 'first_name', 'surname', 'age' and 'address' are the variables you wish to populate in your publication. Of course, when receiving data in this way, you will need to ensure that you have set the publication as the Destination in the Post Web Data action.

I hope this helps. Please do not hesitate to contact me if you have any further queries.

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Posting data from Opus 4 to an ASP page
PostPosted: November 17th, 2004, 12:53 pm 
Offline

Joined: November 16th, 2004, 9:40 pm
Posts: 19
Thanks for your speedy response Robin

It all works perfectly. However when the URL in the Post Web Data Action is to an SSL Site it doesn't seem to work. Is there any way of doing the same, but accessing an ASP page on a secure site (https://)

Thanks

Andrew


For this message kenkofi has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group