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 Rhinorhino 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
Joined
Jul 23, 2001
Messages
1
Location
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