Click to See Complete Forum and Search --> : conditional html


calliepeck
03-08-2006, 03:54 PM
I'm a noob to ASP but trying to convert my PHP CMS to VBscript ASP. This should be basic, but how can I turn this into ASP?


<?php if(variable=1) { ?>
Some Long HTML Form
<?php } ?>


I thought this, but no:

<% if variable=1 then %>
Some Long HTML Form
<% end if %>

JayM
03-08-2006, 03:59 PM
<% if variable=1 then %>


You're setting variable EQUAL to 1. Instead, you should use the comparison operator.


If variable == 1 Then


Cheers

calliepeck
03-08-2006, 04:09 PM
Edited because I'm a moron.

Got it.

JayM
03-08-2006, 04:20 PM
Here's how you obtain data from a querystring:

<a href="page2.asp?myvar=1">click here</a>

qryVariable = Request.Querystring("myvar")

If qryVariable == 1 Then

...

End If

I'm sorry I don't understand what you mean by add to hearing. Hopefully this will clear your confusion up.

EDIT: You edited your post while I was posting the answer :p . Glad you found the solution. :)

Cheers