passing post parameters having space in them

R

ramata

<%

name = request.Form("name")
response.Write "hello " & request.Form("name")

' if name is empty then store some string with space in it
' problem is the word before space 'mr' is passed, but 'programer' is not
passed

if len(name)=0 then
name = "mr programmer"
end if

%>

<form name="test" action="demo.asp" method="post">
<input type=hidden name="name" value=<%=name%> >
<INPUT type="submit" value="Demo" name="Submit">
</form>

------------------------------
Output
------------------------------
hello

on clicking Demo button

hello mr
 
R

Ray Costanzo [MVP]

Think of what it looks like in the browser (or do a view-source)

<input type=hidden name="name" value=mr programmer >

Now, what if it were

<input type=hidden value=mr programmer name=name>

What's the value? mr programmer? mr programmer name? mr programmer
name=name?

You need to use quotes to encaspulate your value.

<input type="hidden" name="name" value="<%=name%>">

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top