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!

linking Variables

Status
Not open for further replies.

MrJones

Programmer
Jul 23, 2001
1
US
I am trying to add a link to an If Then statement. I can get it to work until I add in a variable. Below is my code. The first one works the second does not.Does anyone have a suggestion? Thanks!!
#1
<%
IF Request.Cookies(&quot;lastname_number&quot;) = &quot;&quot; THEN
Response.Write(Variable1)
ELSE
Response.Write(&quot;<a href:page2.asp&quot;>See now</A>
END IF
%>

#2
<%
IF Request.Cookies(&quot;lastname_number&quot;) = &quot;&quot; THEN
Response.Write(Variable1)
ELSE
Response.Write(&quot;h ref:page2.asp?lastname=<%=Request.Cookies(&quot;lastname_number&quot;)%>&quot;>See now</A>
END IF
%>
 
The problem is this line on #2.

ELSE
Response.Write(&quot;h ref:page2.asp?lastname=<%=Request.Cookies(&quot;lastname_number&quot;)%>&quot;>See now</A>

<%= means response.write so you have a response.write inside another response.write.
Change it to

ELSE
Response.Write(&quot;h ref:page2.asp?lastname=&quot; & Request.Cookies(&quot;lastname_number&quot;) & &quot;>See now</A>&quot;)


Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top