Jump to content

[HELP] Request.form isn't working


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 post
Share on other sites

It should work fine. Make your ASP page this and see what happens:

<%user=request.Form("username")pass=request.Form("password")Response.Write("user=" & user)Response.Write("pass=" & pass)%>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...