Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a Variable

Status
Not open for further replies.

Jimuniguy

Technical User
Mar 6, 2002
363
GB
Hi,

I want to write (make it appear on the screen) one of the variables that I have changed after getting it from the querystring, but it does not seem to write it.

E.g. URL is:

Code:
[URL unfurl="true"]Http://www.myisp.com/Hello.htm?Pageref=../introduction.asp[/URL]

Now I am doing this in the code:
Code:
<%
Dim Pagerefold
Pagerefold =  Request.QueryString(&quot;Pageref&quot;)
%>

and later on I need the A HREF link to be that Pagerefold, but doing this:

Code:
<a href=&quot;<%response.write &quot;Pagrefold&quot;%>
  <%=variablestring %>&quot;>Return to page</a>

Why and how do I fix it so that it writes what the variable is, e.g in this case ../introduction.asp

Thank you

James
 
<a href=&quot;<%response.write Pagrefold %>
<%=variablestring %>&quot;>Return to page</a>

 
presuming that your getting the info into the url with no problem, try this:

<%response.write &quot;<a href='&quot;&Pagrefold&&quot;' & '&quot;&variablestring&&quot;'>Return to page</a>&quot;%>

I believe that should work for ya'. In your example you have a &quot;&quot; problem.

<a href=&quot;<%response.write &quot;Pagrefold&quot;%>
<%=variablestring %>&quot;>Return to page</a>

the &quot;&quot; around Pagrefold should be '' instead because you are inside of &quot;&quot; for the href. Also, by being inside the &quot;&quot;, your making it a literal instead of reading the variable. To read the variable the format, generally, is:
'&quot; & variable & &quot;'

HTH
mb
:) &quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
Hi,

Thanks, i tried another way that works and made it into a strmessage before doing a response write like that

Cheers

james
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top