billybob joe Posted March 4, 2008 Share Posted March 4, 2008 <HTML><BODY bgcolor="lightblue"><form action="index.asp" method="get">Your name: <input type="text" name="Name" size="20" />Your name: <input type="text" name="Authentication Code" size="20" /><input type="submit" value="Submit" /></form><%dim fnameName=Request.QueryString("Name")Name=Request.QueryString("Authentication Code")If Name="Gunnar" Then && Authentication Code="Its me, Gunnar, So let me in!" Then Response.Write("Hi, Gunnar, Your so awesome :-)") End If%></body></html> I made this just to test it for something im making... <.< >.> <.< Link to comment Share on other sites More sharing options...
billybob joe Posted March 4, 2008 Author Share Posted March 4, 2008 Is it perfectly fine? I dont think so... cuz its not the server im using, i tested it with normal text diplaying Link to comment Share on other sites More sharing options...
billybob joe Posted March 4, 2008 Author Share Posted March 4, 2008 ... is it unsolvable? 135 people have seen it and no one has answered it... Link to comment Share on other sites More sharing options...
aalbetski Posted March 4, 2008 Share Posted March 4, 2008 add this as the first line <%@ language=vbscript %> correct your syntax of your IF statementfrom If Name="Gunnar" Then && Authentication Code="Its me, Gunnar, So let me in!" Then to: If Name="Gunnar" & AuthenticationCode="Its me, Gunnar, So let me in!" Then the page will now load without error. Any other errors I did not check for Link to comment Share on other sites More sharing options...
zppblood Posted March 4, 2008 Share Posted March 4, 2008 You also assigned Name to two different values; change the second one to AuthenticationCode. You created the variable fname, which I didn't see you use, but not Name and AuthenticationCode. Link to comment Share on other sites More sharing options...
billybob joe Posted March 5, 2008 Author Share Posted March 5, 2008 Urrg... still not working... whats wrong with this?<%@ language=vbscript %><HTML><BODY bgcolor="lightblue"><form action="index.asp?" method="get">Your name: <input type="text" name="Name" size="20" />Authentication Code: <input type="password" AuthenticationCode="Authentication Code" size="20" /><input type="submit" value="Submit" /></form><%dim namedim AuthenticationCodeName=Request.QueryString("Name")Name=Request.QueryString("Authentication Code")If Name="Gunnar" & Password="123" Then Response.Write("Hi, Gunnar, Your so awesome :-)") End If%></body></html> Link to comment Share on other sites More sharing options...
zppblood Posted March 5, 2008 Share Posted March 5, 2008 I'm pretty sure vbscript has to be surrounded by quotation marks like any string value. AuthenticationCode is not an HTML attribute, so I replaced it with name which is and which is used for user submitting information. Dim is a keyword for creating variables. I believe & is suppose to be And. If this doesn't work (I'm not an ASP programmer, and only relying on what I've learned with Visual Basic 6, which uses some of the same syntax), you can always look at the source code of the examples at w3schools.com <%@ language="vbscript" %><HTML><BODY bgcolor="lightblue"><form action="index.asp" method="get">Your name: <input type="text" name="Name" size="20" />Authentication Code: <input type="password" name="AuthenticationCode" size="20" /><input type="submit" value="Submit" /></form><%dim Namedim AuthenticationCodeName=Request.QueryString("Name")Name=Request.QueryString("AuthenticationCode")If Name="Gunnar" And AuthenticationCode="123" ThenResponse.Write("Hi, Gunnar, Your so awesome :-)")End If%></body></html> Link to comment Share on other sites More sharing options...
aalbetski Posted March 5, 2008 Share Posted March 5, 2008 I have corrected your original code so that it works, only minor changes were needed. (I removed the form action, you can put that back) <%@ language=vbscript %><HTML><BODY bgcolor="lightblue"> <form method="get"> Your name: <input type="text" name="Name" size="20" /> Your name: <input type="text" name="Authentication Code" size="20" /> <input type="submit" value="Submit" /> </form><% Name1 = Request.QueryString("Name") Name2 = Request.QueryString("Authentication Code") If Name1="Gunnar" and Name2="Its me, Gunnar, So let me in!" Then Response.Write("Hi, Gunnar, Your so awesome :-)") End If%></body></html> Link to comment Share on other sites More sharing options...
justsomeguy Posted March 5, 2008 Share Posted March 5, 2008 For what it's worth, this was your problem:Name=Request.QueryString("Name")Name=Request.QueryString("AuthenticationCode")You're trying to name them both the same thing. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.