Forums

This topic is locked

code help with IF/THENs

Posted 19 Sep 2002 17:57:57
1
has voted
19 Sep 2002 17:57:57 Chris Mr. posted:
My code:
<% If strUser <> "" Then
<a href="index.asp"><img src="images/but_logout.gif" border="0"></a>
Else
<a href="login.asp"><img src="images/but_signin.gif" border="0"></a>
End If %>

And the error:
Expected statement

/TMP9zg5e2p0n1.asp, line 57

<a href="index.asp"><img src="images/but_logout.gif" border="0"></a>

Any ideas?

Thanks

.GrillCheese

Replies

Replied 19 Sep 2002 23:35:50
19 Sep 2002 23:35:50 Owen Eastwick replied:
You have mixed the HTML in with the VBScript, missing off some of the script opening and closing tags, try:

<% If strUser <> "" Then %>
<a href="index.asp"><img src="images/but_logout.gif" border="0"></a>
<% Else %>
<a href="login.asp"><img src="images/but_signin.gif" border="0"></a>
<% End If %>

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 20 Sep 2002 03:51:31
20 Sep 2002 03:51:31 Martin Yde replied:
hi another way of doing is :
<% If strUser <> "" Then
response.write ("<a href='index.asp'><img src='images/but_logout.gif' border='0'></a>"
Else
response.write ("<a href='login.asp'><img src='images/but_signin.gif' border='0'></a>
End If %>

i just switch out double quots with single ones.

actually im lookink for a way to make DMX always use single quotes instead of doubles when writing html atribs .
hmmm but that was another post <img src=../images/dwzone/forum/icon_smile_big.gif border=0 align=middle>

Reply to this topic