473,387 Members | 1,534 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,387 software developers and data experts.

post variable

I have a VB application sending data via post to an ASP page.

The application sends two variable: id, txt

If txt has the & sign in its string, it cause trouble. E.g.:
id = 1
txt = "Hello & more"

If I take a look into Request.Form() array in asp page, it shows the
following:
id = 1
txt = "Hello "
more = ""

I guess I have to encode the txt variable in my VB application and
uncode it on the receiving part. Wondering that I can not pass variable
like "Hello & more" directly via post to an asp page. Is there any
change to get the right content from txt without modify the VB
application?

Thanks for help.

Jul 22 '05 #1
5 3732
cr***@gmx.de wrote:
I have a VB application sending data via post to an ASP page.

The application sends two variable: id, txt

If txt has the & sign in its string, it cause trouble. E.g.:
id = 1
txt = "Hello & more"

If I take a look into Request.Form() array in asp page, it shows the
following:
id = 1
txt = "Hello "
more = ""

I guess I have to encode the txt variable in my VB application and
uncode it on the receiving part. Wondering that I can not pass
variable like "Hello & more" directly via post to an asp page. Is
there any change to get the right content from txt without modify the
VB application?

Thanks for help.


Given that this test produces the expected results:
<%
for each key in Request.Form
Response.Write key & ": " & Request.Form(key) & "<BR>"
next
%>
<HTML>
<BODY>

<FORM action="" method=POST id=form1 name=form1>
<INPUT type="text" id=text1 name=id value="1">
<INPUT type="text" id=text2 name=txt value="this text & More text">
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</FORM>

</BODY>
</HTML>
I have to say that the method you are using to post the data is causing the
problem. What are you using to post the data? XMLHTTP? Something else? Let's
see a little code to help us reproduce the problem.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2
Hi Bob,
I have to say that the method you are using to post the data causing

the problem.

You are probably right. Then I am here in the wrong group. However, if
someone want help me, here is the code from my VB application:

szPostData = "id=" & strID & "&" & "txt=" & strText
myInet.Execute , "POST", szPostData, _
"Content-Type:
application/x-www-form-urlencoded"

I guess this is because I'm using application/x-www-form-urlencoded.
Are there exist other types then application/x-www-form-urlencoded
which can be used together with inet control? I checked the docs, but
was unable to find anything usable. Or have I to urlencode my
szPostData and uncode it on the asp site (worst case for me)?

Thank you for help.

Jul 22 '05 #3
cr***@gmx.de wrote:
Hi Bob,
I have to say that the method you are using to post the data causing
the problem.


You are probably right. Then I am here in the wrong group. However, if
someone want help me, here is the code from my VB application:

szPostData = "id=" & strID & "&" & "txt=" & strText
myInet.Execute , "POST", szPostData, _
"Content-Type:
application/x-www-form-urlencoded"

I guess this is because I'm using application/x-www-form-urlencoded.
Are there exist other types then application/x-www-form-urlencoded
which can be used together with inet control? I checked the docs, but
was unable to find anything usable. Or have I to urlencode my
szPostData and uncode it on the asp site (worst case for me)?

Thank you for help.

What is myInet? There are several components out there that enable you to
post data to asp pages ...

I've had good success using the XMLHTTPRequest object that comes with the
MSXML parser.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #4
> What is myInet?

Sorry I forgot to mention this very important point. It is VB6 inet
control. The apptlication is written in VB6. In fact, this application
was original written in 1998. So all of its client server communication
is based on this inet control.

Jul 22 '05 #5
Try to encode the & using for example &amp;

Not familiar with the raw level format but it's likely that fields are
posted using name1=value1&name2=value2 and that's conflict with your use of
&.

In the worst case see the RFC or see how an HTML page encodes this (using
Request.BinaryRead) so that you can stuff your variable with the appropriate
replacement for the & character...

Patrice

--

<cr***@gmx.de> a écrit dans le message de
news:11**********************@f14g2000cwb.googlegr oups.com...
What is myInet?


Sorry I forgot to mention this very important point. It is VB6 inet
control. The apptlication is written in VB6. In fact, this application
was original written in 1998. So all of its client server communication
is based on this inet control.

Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Spud | last post by:
<?php // pullpage function by Nick bouton http://www.nickbouton.com/. $CustomerID = "IDHERE"; $method = "POST"; $host = "xml.mydata.com"; $usepath = "/xml.asp"; //print all vars in an...
3
by: Thomas Hoheneder | last post by:
Hello, I use PHP 4.3.10 and want to deliver a post variable from a PHP page to itself. In my page mypage.php I have a hidden field named "dbaction" and a form button. When clicking the form...
4
by: Lee David | last post by:
I have a validation form that lets you enter your ID and password. Then I call the page again. This time the page script should check that it is a "recall" and check the entered data with the...
15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
3
by: Geoff | last post by:
I have been asked to add postal rates to a web page shopping cart checkout procedure. After contacting the post office I discovered that they used XML to receive postal rate requests and send back...
6
by: Stephen Cook | last post by:
Having worked through the problems around enabling the document function using an XmlUrlResolver I started work on building a useful class to hide the intricacies. Trying to generalise the process...
18
by: Patrick Wood | last post by:
I found a problem with C# and post increments. I was going through some source code in c++ and found someone did a post increment: int x=0; for(int i=0; i<10; i++) { x = x++; }
5
by: Chuck Anderson | last post by:
I have finally started coding with register_globals off (crowd roars - yeay!). This has created a situation that I am not sure how I should handle. I have scripts (pages) that can receive an...
1
by: unknown; | last post by:
hello i'm using a php script opening en parsing a url like www.OpenThisURL.com/site.php?a=aa&b=bb this url and website are not mine but i'm only using some information from the site. now...
5
by: pavloutefkros | last post by:
sorry for creating a new post but this is totally different from the previous one. Here is the problem (which is very hard to explain, so i will use a paradigm): i submit a form and the post...
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:
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.