Jump to content

[HELP] Request.form isn't working


eko_wardoyo
 Share

Recommended Posts

i've troubled with request.form because request.form in my script don't send any value so server will filter that username is incorrecthere is form login:

<html><head><title>Halaman Login</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><form name="form1" action="cek_user.asp" method="post">  <table width="365" border="0" cellpadding="0" cellspacing="0" align="center">	<!--DWLayoutTable-->	<tr> 	  <td height="31" colspan="3" align="center" valign="top"><b>Login Form</b></td>	</tr>	<tr> 	  <td width="76" height="22" valign="top">Username</td>	  <td colspan="2" valign="top"> <input type="text" name="username" size="40"> 	  </td>	</tr>	<tr> 	  <td height="22" valign="top">Password</td>	  <td colspan="2" valign="top"> <input type="password" name="password" size="40"> 	  </td>	</tr>	<tr> 	  <td height="24" valign="top"><a href="daftar.asp">Daftar</a> </td>	  <td width="56" valign="top"> <input type="submit" name="Submit" value="Login"> 	  </td>	  <td width="233"> </td>	</tr>	<tr> 	  <td height="17"></td>	  <td></td>	  <td></td>	</tr>  </table></form></body></html>

here is the script cek_user.asp for check username and password:

<!-- #include file="koneksi.asp"-->user=request.Form("username")pass=request.Form("password")SQL="select*from data_user where username='" & user & "' and password='" & pass & "'" 'buat recordset objectset rstUser=server.CreateObject("ADODB.Recordset")'buka recordrstUser.open SQL,konekif not rstUser.eof then 'valid username and password in databasesession("username")=userresponse.Redirect("hal_utama.asp")else response.Write("Anda gagal login!<br>")response.Write("Silahkan Anda <a href='login.asp'>Login</a> kembali")end if%>

i've also tried to write the variable username in browser, the result that variable is emptycan you help me???

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...