|

楼主 |
发表于 2004-4-28 20:13:55
|
显示全部楼层
大致如下:
<?php
require 'main.inc';
$hostname='127.0.0.1';
//$username=$arr_request['username'];
//$password=$arr_request['password'];
//$link_id=mysql_connect($hostname,$username,$password);
$link_id=mysql_connect($hostname,'root','root密码');
echo "link : $link_id";(这儿输出的是“link: Resource id #1”)
if (!$link_id || !$username)
{
show_title("用户登陆");
show_msg("请输入用户名和密码:");
echo '<form method="post" action='.$PHP_SELF.'>';
echo '<table>';
echo '<tr>
<td>用户:</td><td><input type="text" name="username"
value="root"></td>
</tr>';
echo '<tr>
<td>密码:</td><td><input type="password" name="password"></td>
</tr>';
echo '<tr>
<td><input type="submit" value="确定"></td>
</tr>';
echo '</table>';
show_err();
echo '</form>';
show_foot();
}else{
show_title("登陆成功");
show_msg("成功登陆到MySQL");
show_foot();
}
?> |
|