complete asp parameters passed well ...sort of

I have an as page thta passes:

<a href= http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T&Tema=" & MyRecordSet("Var")><img src=image.gif  border="0"></a>

The link to the image is passed complete:

at least it appearsto be ok in the asp generated code:

http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T&Tema=Finance (for example)


Now clicking con the image runs listcur.asp?Criterio=T and truncates the last part

ntsite.net/apuntate/listcur.asp?Criterio=T  not passing the Tema=Finance  variable

How can I pass it complete?
robrodpAsked:
Who is Participating?
 
fozyletConnect With a Mentor Commented:
imgref="http://ntsite.net/apuntate/stats.asp?liga=" & Server.URLEncode("ntsite.net/apuntate/listcur.asp?Criterio=T" & Trim(MyRecordSet("Tema")))
0
 
fritz_the_blankCommented:
I am suspecting that there is a space or an illegal character involved. Try using Server.URLEncode() to solve this:

Server.URLEncode(MyRecordSet("Var"))

As an aside, shouldn't that be something like:

<a href= "http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T&Tema=<%=Server.URLEncode(MyRecordSet("Var"))%>"><img src=image.gif  border="0"></a>

FtB

0
 
robrodpAuthor Commented:
Hi

Just tried the Server.URLEncode and it still misses the last part
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
robrodpAuthor Commented:
And remember the line is actually generetd from an asp command, mainly:

a variable is created, and later used

<%imgref="http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T&Tema=" & MyRecordSet("Tema")%>

<a href= <%=imgref%>>
<img src="http://apuntate.com.mx/<%=imgname%>" border="0"></a>
0
 
_-MYFOX-_Commented:
check on your stats.asp when you take then liga variables...
the string is truncate after the first "&"...
look for the correct "".. sintatax, or post the script section.
0
 
robrodpAuthor Commented:
Hi

I tried a vanilla likk passing a constant

<%imgref="http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T&Tema=Hogar" %>


There are no "" to worry about (just the first and the last)

The script use is the following:

<%Set MyConnection = Server.CreateObject("ADODB.Connection")
Set MyCommand = Server.CreateObject("ADODB.Command")
Set MyRecordSet = Server.CreateObject("ADODB.RecordSet")
MyConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D:\root\rparker\ntsite.net\db\clas.mdb"
MyCommand.ActiveConnection=MyConnection
MyCommand.CommandType=adCmdText
Sql="Select * From clas"
MyCommand.CommandText=Sql
MyRecordSet.Open MyCommand,,adOpenStatic,adCmdTable%>
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000" background="fondo.gif" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
<center>
<table  BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=5 WIDTH="800">
<%do while not MyRecordSet.Eof%>
<tr>
<%for x=1 to 5%>
<td align=left>
<%if not MyRecordSet.eof then
imgname= MyRecordSet("imagen")
imgref="http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T" & MyRecordSet("Tema")%>
<a href= <%=imgref%>>
<img src="http://apuntate.com.mx/<%=imgname%>" border="0"></a>
</td>
<%MyRecordSet.MoveNext
end if%>

<%next%>
</tr>
<%loop%>
</table>
<%MyRecordSet.Close%>
<%MyConnection.Close%>

0
 
justinbilligCommented:
shouldn't this line

imgref="http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T" & MyRecordSet("Tema")%>

be this

imgref="http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T&Tema" & MyRecordSet("Tema")%>


your missing the extra parameter. What you could do is after the browsers renders the HTML view the source and see what exactly is being generated
0
 
ajaikumarrCommented:
Hai,

Try this,

Replace these lines
<%if not MyRecordSet.eof then
imgname= MyRecordSet("imagen")
imgref="http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T" & MyRecordSet("Tema")%>
<a href= <%=imgref%>>
<img src="http://apuntate.com.mx/<%=imgname%>" border="0"></a>
</td>
<%MyRecordSet.MoveNext
end if%>

with

<%
if not MyRecordSet.eof then
      imgname=Trim(MyRecordSet("imagen"))
      imgref="http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T" & Trim(MyRecordSet("Tema"))
      Response.write "<a href=""" & imgref & """><img src=""http://apuntate.com.mx/" & imgname & """ border=""0""></a>"
      Response.write "</td>"
      MyRecordSet.MoveNext
end if
%>

Bye
Ajai
0
 
robrodpAuthor Commented:
Actually that is the way it is.... this firts posts are correct... something was lost in the posting
0
 
ajaikumarrCommented:
Sorry

With this

<%
if not MyRecordSet.eof then
     imgname=Trim(MyRecordSet("imagen"))
     imgref="http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T&Tema=" & Trim(MyRecordSet("Tema"))
     Response.write "<a href=""" & imgref & """><img src=""http://apuntate.com.mx/" & imgname & """ border=""0""></a>"
     Response.write "</td>"
     MyRecordSet.MoveNext
end if
%>

Bye
Ajai
0
 
robrodpAuthor Commented:
The a very simplified version of the stats.asp is, and simply ignores the part of liga after the &. The variable is past correctly in the first asp program.

<%@ Language=VBScript%>
<%Response.Buffer=true%>
<%Response.Expires = 0%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
      <title>Foraneas</title>
</head>
<body>
<%
      Response.Redirect "http://" & Request.QueryString("liga")
%>
</body>
</html>


try:

http://ntsite.net/apuntate.asp/bottomt.asp

The small icons at the bottom reflect the coorect variable, once you clcik them the stats.asp ignores the data after the &
0
 
robrodpAuthor Commented:
0
 
robrodpAuthor Commented:
Also if you click inthe following you get the same error (stats.asp i really simple, it just redirects)

http://ntsite.net/apuntate/stats.asp?liga=ntsite.net/apuntate/listcur.asp?Criterio=T&Tema=Administración
0
 
ajaikumarrCommented:
Hai,

Try like this.

<%
     Response.Redirect "http://" & Request.QueryString()
%>

Bye
Ajai
0
 
ajaikumarrCommented:
Hai,

Or this

<%
     Response.Redirect "http://" & Replace(Request.QueryString(), "liga=", "")
%>

Bye
Ajai
0
 
ajaikumarrCommented:
If ignore case sensitive of "liga=" then use the below one

Response.Redirect "http://" & Replace(Request.QueryString(), "liga=", "", 1, -1, 1)

Bye
Ajai
0
 
kiddangerCommented:
It's the & and needs to be encoded to %26.  The same as your other question.
0
 
fritz_the_blankCommented:
I am glad to see that my suggestion of using the Server.URLEncode and to use proper concactonation was of at least some use...

ftB
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.