![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Posts: 18
Rep Power: 0
![]() |
Help
Hi ..
I am new here and i really need help .. In ASP This is the form code <form name="login" method="post" action="confirm.asp">
<div align="center">
<p><br>
<strong><span class="style16">Please insert your username and password to log into the system. </span></strong></p>
<table width="312" border="1" cellspacing="3" bordercolor="#000000">
<tr>
<td width="92"><span class="style15">Username:</span></td>
<td width="195" colspan="2"><input type=text name="username" size="25"></td>
</tr>
<tr>
<td><span class="style15">Password:</span></td>
<td colspan="2"><input type=text name="password" size="25"></td>
</tr>
<tr>
<td colspan="3"><div align="center">
<input name="Submit" type="submit" value="Submit">
</div></td>
</tr>
</table>
<br>
</div>
</form>This is the confirm.asp <%
DIM strUsername, strPassword
strUsername = Request.Form("username")
strPassword = Request.Form("password")
IF strUsername <> "" AND strPassword <> "" THEN
' Process the form as you like here
' For example enter form to your database or send it via email
ELSE
Response.Write "<p>Please click back on your browser and complete the following fields:</p>"
IF strUsername <> "" THEN
ELSE
Response.Write "<b>• Username</b><br>"
END IF
IF strPassword<> "" THEN
ELSE
Response.Write "<b>• Password</b><br>"
END IF
END IF
%>But it doesnt work .. All i want is to check if the username and password match then they willl log in |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Feb 2006
Posts: 18
Rep Power: 0
![]() |
Can someone just tell what is wrong with the code please
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Feb 2006
Posts: 7
Rep Power: 0
![]() |
I don't think there's anything wrong with your code
have you tested it? |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Feb 2006
Posts: 18
Rep Power: 0
![]() |
yes i did .. it takes me to the next page in all cases!
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Feb 2006
Posts: 18
Rep Power: 0
![]() |
Hi again .. ok lets say when the username and pass are correct
i want the user to directly go to the menu.asp page ... how can i do that? |
|
|
|
|
|
#6 | ||
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 3
![]() |
Quote:
Quote:
response.AddHeader "location", "menu.asp" If you want the user to see the message for let's say 5 seconds, use this code: <meta http-equiv="refresh" content="5;url=menu.asp"> |
||
|
|
|
|
|
#7 |
|
Newbie
Join Date: Feb 2006
Posts: 18
Rep Power: 0
![]() |
<meta http-equiv="refresh" content="5;url=menu.asp"> Where do i have to put it will this do? strUsername = Request.Form ("username")
strPassword = Request.Form ("password")
If strUsername="john" And strPassword="123" Then
Response.Write("OK to go!")
<meta http-equiv="refresh" content="5;url=menu.asp">
End IfThank you ! |
|
|
|
|
|
#8 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 3
![]() |
You have to put it in the header section of the HTML part.
|
|
|
|
|
|
#9 |
|
Newbie
Join Date: Feb 2006
Posts: 18
Rep Power: 0
![]() |
Aha thank you!
|
|
|
|
|
|
#10 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 9
![]() |
Welcome to the forums, but please read the rules/FAQ and a "How to Post..." thread. "HELP" is not an acceptable subject line.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|