Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 17th, 2008, 03:53 PM
Authorized User
 
Join Date: Dec 2005
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP variables to XML submission form- HELP!!!

I'm working on a page that requests variables from an .asp form page, then ships the variables to the next page via XML. Here's a snippet of the code with the pertinent fields.

This page works just fine as long as the variable is coded in, but when I try to reference the ASP variable, it fails.

Any ideas on how to make this asp page put the xml variables through to the next page properly?

productid = Request.QueryString("productid")


strXML = strXML & "<productid>A1b23C4</productid>" & vbcrlf


If I try to do this: strXML = strXML & "productid" & productid & "</productid>" & vbcrlf
it fails.

HELP PLEASE.
 
Old December 17th, 2008, 10:17 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

You REALLY don't see any difference there??????
Code:
strXML = strXML & "<productid>A1b23C4</productid>" & vbcrlf
 
 
strXML = strXML & "productid" & productid & "</productid>" & vbcrlf
Honest, XML *does* pay attention to the < and > markers.
 
Old December 18th, 2008, 01:02 PM
Authorized User
 
Join Date: Dec 2005
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Yes, I do see that...but it was a typo

Sorry about that...sometimes my fingers just dont do what I tell them to.

What I 'meant' to type was:



strXML = strXML & "<productid>" & productid & "</productid>" & vbcrlf

Is this the correct syntax?

Thanks!
 
Old December 18th, 2008, 04:32 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Looks fine to me.

You still get an error? What's the error?

Have you tried viewing the page with FireFox and then doing VIEW==>>PAGE SOURCE from FF? FF will let you see the XML it's trying to display even if the XML is bogus. Makes it much easier to debug. (MSIE will often just refuse to show anything.) I always flip-flop back and forth between FF and MSIE when working with XML because each has some debugging feature the other doesn't.

Oh...and another trick to pull:

Instead of just doing
Response.Write strXML
do
Response.Write Replace( strXML, "<", "&lt;" )





Similar Threads
Thread Thread Starter Forum Replies Last Post
form submission...help!? mdbrueckner ASP.NET 2.0 Basics 1 September 19th, 2007 06:16 PM
conditional form submission moushumi Classic ASP Basics 1 March 30th, 2004 08:12 AM
Clearing values from form and ASP variables sniffer Classic ASP Basics 1 September 24th, 2003 02:40 AM





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