Jump to content


Photo

why the button cant work


  • Please log in to reply
2 replies to this topic

#1 lmy52

lmy52
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 December 2003 - 04:16 AM

hi to all,

this is the first script i try to do. i use dreamweaver to create the interface of a login page. the question is where to put the <form method = \"post\" action = \"file.php\"> between the html file. can somebody give me the idea. here is what i have done but the login button cannot function. please help and i have try it for 2 days but still cant work.
:cry:
[php:1:f07e94bbe3]
<?php

@ $name = $HTTP_POST_VARS [\'name\'];
@ $password = $HTTP_POST_VARS[\'password\'];

if (empty($name)||empty($password))
{
?>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<link href=\"upload/pos.css\" rel=\"stylesheet\" type=\"text/css\">
<link href=\"upload/bannerIPTS.css\" rel=\"stylesheet\" type=\"text/css\">

<body bgcolor=\"#669966\">
<div align=\"center\"></div>
<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"geen\">
<!--DWLayoutTable-->
<tr>
<td width=\"42\" height=\"59\">&nbsp;</td>
<td colspan=\"5\" valign=\"top\" class=\"bannerIPTS\"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width=\"41\">&nbsp;</td>
</tr>
<tr>
<td colspan=\"2\" rowspan=\"3\" valign=\"top\" class=\"geen\"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width=\"100%\" height=\"54\" valign=\"top\"><p align=\"center\" class=\"grey\"><font size=\"5\">Upload
Notes <br>

</font><font size=\"5\">User : lecturer / Password: pass</font></p></td>
<td width=\"20\">&nbsp;</td>
<td width=\"1\">&nbsp;</td>
<td colspan=\"2\" rowspan=\"3\" valign=\"top\" class=\"geen\"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<tr>
<td height=\"46\">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height=\"220\" colspan=\"2\" valign=\"top\" class=\"pos\"><p>&nbsp;</p>
<p>&nbsp; </p>

<h2 align=\"center\"> Please Log In</h2>
<form method=\"post\" action=\"login.php\">

<form name=\"form1\" method=\"post\">
<p align=\"center\">User Name:
<input name=\"username\" type=\"text\" id=\"username\" size=\"20.\">
</p>
<p align=\"center\"> Password :
<input name=\"password\" type=\"text\" id=\"password\" size=\"20\" maxlength=\"20\">
</p>
</form>
<form name=\"form2\" method=\"post\">
<div align=\"center\">
<input name=\"login\" type=\"submit\" id=\"login\" value=\"Login\">
</div>
<tr>
<td colspan=\"2\">&nbsp;
</form>

</form>

<p>&nbsp; </p></td>
<td></td>
</tr>
<tr>
<td height=\"104\">&nbsp;</td>
<td width=\"121\">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width=\"93\">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height=\"1\"><img src=\"spacer.gif\" alt=\"\" width=\"42\" height=\"1\"></td>
<td><img src=\"spacer.gif\" alt=\"\" width=\"121\" height=\"1\"></td>
<td></td>
<td><img src=\"spacer.gif\" alt=\"\" width=\"20\" height=\"1\"></td>
<td><img src=\"spacer.gif\" alt=\"\" width=\"1\" height=\"1\"></td>
<td><img src=\"spacer.gif\" alt=\"\" width=\"93\" height=\"1\"></td>
<td><img src=\"spacer.gif\" alt=\"\" width=\"41\" height=\"1\"></td>
</tr>
</table>

<?php
}

else if ($name == \'user\'&& $password == \'pass\')
{
echo \'<h1> Here it is!</h1>\';
}
else
{
echo \'<h1>You are not authorized to view this resource.</h1>\';
}
?>



<?php

?>[/php:1:f07e94bbe3]

#2 Rheal

Rheal
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 11 December 2003 - 05:28 PM

Your button has to be placed somewhere between the 2 form tags

<form>

place submit button here

</form

Dreamweaver dose this for you...shouldnt be too hard

#3 lmy52

lmy52
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 12 December 2003 - 03:01 AM

Thanks for your advice. Can work now. :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users