Jump to content

why the button cant work


Recommended Posts

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\"> </td>

<td colspan=\"5\" valign=\"top\" class=\"bannerIPTS\"><!--DWLayoutEmptyCell--> </td>

<td width=\"41\"> </td>

</tr>

<tr>

<td colspan=\"2\" rowspan=\"3\" valign=\"top\" class=\"geen\"><!--DWLayoutEmptyCell--> </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\"> </td>

<td width=\"1\"> </td>

<td colspan=\"2\" rowspan=\"3\" valign=\"top\" class=\"geen\"><!--DWLayoutEmptyCell--> </td>

</tr>

<tr>

<td height=\"46\"> </td>

<td> </td>

<td> </td>

</tr>

<tr>

<td height=\"220\" colspan=\"2\" valign=\"top\" class=\"pos\"><p> </p>

<p>  </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\"> 

</form>

 

</form>

 

<p>  </p></td>

<td></td>

</tr>

<tr>

<td height=\"104\"> </td>

<td width=\"121\"> </td>

<td> </td>

<td> </td>

<td> </td>

<td width=\"93\"> </td>

<td> </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]

Link to comment
https://forums.phpfreaks.com/topic/1466-why-the-button-cant-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.