?
Solved

complete asp parameters passed well ...sort of

Posted on 2005-04-19
18
Medium Priority
?
335 Views
Last Modified: 2008-02-01
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?
0
Comment
Question by:robrodp
  • 7
  • 5
  • 2
  • +4
18 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 13820800
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
 

Author Comment

by:robrodp
ID: 13820815
Hi

Just tried the Server.URLEncode and it still misses the last part
0
 

Author Comment

by:robrodp
ID: 13820825
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Expert Comment

by:_-MYFOX-_
ID: 13820877
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
 

Author Comment

by:robrodp
ID: 13820888
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
 
LVL 15

Expert Comment

by:justinbillig
ID: 13821079
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
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 13821167
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
 

Author Comment

by:robrodp
ID: 13821174
Actually that is the way it is.... this firts posts are correct... something was lost in the posting
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 13821177
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
 

Author Comment

by:robrodp
ID: 13821244
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
 

Author Comment

by:robrodp
ID: 13821247
0
 

Author Comment

by:robrodp
ID: 13821263
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
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 13821648
Hai,

Try like this.

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

Bye
Ajai
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 13821659
Hai,

Or this

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

Bye
Ajai
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 13821666
If ignore case sensitive of "liga=" then use the below one

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

Bye
Ajai
0
 
LVL 14

Expert Comment

by:kiddanger
ID: 13821690
It's the & and needs to be encoded to %26.  The same as your other question.
0
 
LVL 8

Accepted Solution

by:
fozylet earned 2000 total points
ID: 13822289
imgref="http://ntsite.net/apuntate/stats.asp?liga=" & Server.URLEncode("ntsite.net/apuntate/listcur.asp?Criterio=T" & Trim(MyRecordSet("Tema")))
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 13825055
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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question