?
Solved

Using VB5-Cgi Objects to pass variables to webpage

Posted on 1998-12-29
4
Medium Priority
?
178 Views
Last Modified: 2013-12-25
I'm using VB5-CGI Objects to write cgi and Access 97 to
   keep my data.  I have a webpage which displays the result after querying the
   database.  The result will have a hyperlink to another webpage.  I want to pass the
   result to the final webpage.  So, I use HTML.bodyHTML to write like this...

   <a href="http://default/sample.htm?Data1=" & rs.Fields("Data1") & "&Data2=" &
   rs.Fields("Data2") & "&Data3=" & rs.Fields("Data3")  target="blank"> "   

   But the final webpage can only get the value of Data1, it can't get the others.  If my
   Data1 has the value of "My data", the final webpage gets only 'My', but no 'data'.  

   So, how should I pass variables using VB5-CGI Objects?  Please help...

   Thanks in advance...
0
Comment
Question by:hor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:hor
ID: 1830315
Adjusted points to 150
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1830316
The problem you are suffering is that you are putting invalid characters into the url. In your example the space between 'My' and 'data' needs to be converted to a '+'.

Ths is known as URL Encoding which means that any character after the question mark that is not valid within a URL is encoded as a + if it is a space or its ASCII value in Hex preceded by a %.

VB is not the easiest language to do this in but fortunately the server object has a URLEncode method that will do the job for us so your code should be changed to the following.

<a href="http://default/sample.htm?Data1=" & Server.URLEncode(rs.Fields("Data1")) & "&Data2=" & 
   Server.URLEncode(rs.Fields("Data2")) & "&Data3=" & Server.URLEncode(rs.Fields("Data3"))  target="blank"> "   

Hope this helps

Steve
0
 

Author Comment

by:hor
ID: 1830317
What references or components should I use so that the Server.URLEncode() will be accepted by VB5 when I press F5?
0
 
LVL 11

Accepted Solution

by:
mouatts earned 150 total points
ID: 1830318
Sorry I misunderstood that you were writing vbScript thus I don't really know what you are talking about when you say 'press F5'

Nevertheless that basic problem is still the same. Convert the spaces to + and the url will be fine so long as the remainder of the url doesn't contain punctuation characters.

Steve
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question