Mike said:
Can anybody tell me what is wrong with this code? I am thinking it is
something to do with how I am escaping the quotes.
<img src="pix2.asp?lbmid=" & Request.QueryString("LBMID") &
"&LBMEmail=" & Request.QueryString("LBMEmail") & """ width=1
height=1 border=0>
Two things:
You failed to delineate the server-side code from the client-side html.
Why are you trying to inject a quote there at the end?
Actually 3 things:
You failed to describe your symptoms. At least view the page source after
running the page and show us the resulting img tag, or tell us what the
error message is.
Anyways, the long version:
<img src="pix2.asp?lbmid="
<%Response.Write Request.QueryString("LBMID") %>
&LBMEmail=
<%Response.Write Request.QueryString("LBMEmail") %>
" width=1 height=1 border=0>
The shortcut that most people use:
<img src="pix2.asp?lbmid="<%=Request.QueryString("LBMID")%>
&LBMEmail=<%=Request.QueryString("LBMEmail")%>" width=1 height=1 border=0>
The idea is to write the html the way it should look with hard-coded values:
<img src="pix2.asp?lbmid=12345&
[email protected]" width=1 height=1
border=0>
Then replace the hard-coded values with the server-side script blocks. There
is no need to do the concatenation inside the server-script blocks. Yes, you
could have done this:
<img src="pix2.asp?lbmid="<%=Request.QueryString("LBMID") & "&LBMEmail=" &
Request.QueryString("LBMEmail")%>" width=1 height=1 border=0>
but it can get confusing and there really is no need to do this unless you
are making decisions in the server-side code as to what name-value pairs are
being included in the querystring.