473,594 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3737
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(ke y) & "<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&na me2=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.BinaryR ead) 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.goo glegroups.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
2444
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 array
3
2669
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 button a javascript function is called where the dbaction hidden field is set to the value "change" (=actn) and then the form gets submitted. function doAction(actn) { document.forms.dbaction.value = actn;
4
2306
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 database. With a match, set three cookies (this doesn't work) and redirect to another page. With a miss, see the cookies to "guest" values and redirect to a different page. When I "echo" from within the code (for testing), it displays showing the...
15
3117
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. When I find is that if I send the value by the GET method, response.write("From QueryString: " & Request.QueryString("usernamefromform") & "<br><br>")
3
4247
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 the rate for a certain size, "from:" address, "To:" address and delivery service speed. The examples they showed used a HTML "Text Area" and a HTTP post statement to send the request however I need to use input from an input box and then insert...
6
2475
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 I've hit a snag. How do I resolve multiple external references? The transform method on a stylesheet only takes one resolver, not an array Stephen
18
1912
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
5371
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 input variable from the POST array (initial entry) or it could be in the GET array (go back and re-edit a form, for instance.) In my old sloppy scripting days this was no problem, as I had register_globals on and would merely access the the input...
1
2427
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 this site has changed and the GET variable a=aa & b=bb have
5
1572
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 variable is being sent to the page test.py. then the test.py retrieves the POST and print it to the page. now everything is great except one thing. lets say i submitted the form and went to test.py and the output was correct, then, while i'm on...
0
7947
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7880
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8255
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8010
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6665
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5413
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.