PDA

View Full Version : HTML form


dt
11-22-2004, 05:42 AM
Is there anything wrong:<this form also can be accessed at http://rugalaxy.com/testform.htm> Not working on my web where as it works perfectly on my local server.


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>User ID</title>
</head>
[b]
<form action="./test.php" method="post" name="user"><div class="right"><table summary="" border="0" cellpadding="2" cellspacing="0"><tr><td class="right">User ID:</td><td><input type="text" value="" name="id" size="25"></td></tr><tr><td class="right">Password:</td><td><input type="password" value="" name="pw" size="25"></td></tr><tr><td></td><td><input type="submit" value="LOG IN">&amp;nbsp;<a href="./guest/index.php/" class="topbutton">GUEST</a></td></tr></table></div></form>
</body>
</html>




<?php


if (empty($id)) {


echo ("


<h3 align=\"center\">


You did not type in your username.


</h3>


");


exit;


}





if (empty($pw)) {


echo ("


<h3 align=\"center\">


You did not type in your password.


</h3>


");


exit;


}


?>

dt
11-22-2004, 07:32 AM
Thanks, I changed id to uname both in html and php still the same problem.

DT

bluebeard96
11-22-2004, 07:36 AM
Ignore my last post... I figured it out.


http://www.codedemons.net/index/tips/PHP/Use-POST-Instead-of-Variable-Name


You need to check$_POST['id'] instead of$id - same with pw


Working example at http://www.kiwanispq.org/dev/form.html



Mike Reilly, Secretary/Webmaster
Kiwanis Club of Rancho Penasquitos
"Serving the Children of the World"
Mike@KiwanisPQ.org
(760) 419-7429

dt
11-22-2004, 08:40 AM
Yes, it is working at http://www.kiwanispq.org/dev/form.htmlbut even after changing it is not working on my site http://rugalaxy.com/testform.htm

DT

dt
11-22-2004, 08:43 AM
Yes, it started working post shoud be POST.