Print Page | Close Window

Why doesnt this work?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2127
Printed Date: 29 March 2026 at 12:00pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Why doesnt this work?
Posted By: Dazz
Subject: Why doesnt this work?
Date Posted: 25 April 2003 at 9:43am

I want to display an image for an e-mail link if the person who signed my guestbook gave an e-mail address I wrote the script bel;ow but it does not work it just displays the image whether there is an e-mail address or not. Why doesnt this work?

If rsGuestbook("Email") = "" THEN Response.Write (" ") ELSE Response.Write ("<a href=""" & rsGuestbook("Email") & """><img src=""images/email.gif"" width=""100"" height=""20""></a>") END IF




Replies:
Posted By: ultramods
Date Posted: 25 April 2003 at 10:01am
what happens if you do RESPONSE.WRITE(rsGuestbook("Email") ) before your if statement, if the isnt an email address for that user. i.e is there nothing?


Posted By: Scotty32
Date Posted: 25 April 2003 at 11:01am

ummm i dunno wot "ultramods" was on about

but try puttin the "Response.write()" on the next line, and then the "end if" on another

i think it affected sumfin i did once

also if you get an error message try showing us it



Posted By: ultramods
Date Posted: 25 April 2003 at 11:53am

"ultramods" was on about whether a user that was suppose to have no email address may actually have something stored in the email field for their record in the database. which would cause "If rsGuestbook("Email") = "" " not to work. I think its called testing-starting from the top and working down. If that test failed then another could be carried out.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net