+ -
当前位置:首页 → 问答吧 → 登陆不了啊

登陆不了啊

时间:2011-09-24

来源:互联网

PHP code
<?php include_once conn.php";?>
<?php 
$laiu=$_POST["shangu"];
$laim=$_POST["shangm"];
$laim=md5($laim);//写数据库时候也用MD5了
$sql=mysql_query("select from biao where username='$laiu' and password='$laim'");
if($sql==0){
echo "o,shit";
exit();
}else{
echo "登陆成功了";
}
?>

-------------------------
怎么老是不能登陆! 闷!

作者: xiexie11o   发布时间: 2011-09-24

可以这样写的吗?
"select from biao where username=

作者: PhpNewnew   发布时间: 2011-09-24

"select * /id 起码要加个字段吧。。要不然就用*

作者: jordan102   发布时间: 2011-09-24

什么意思??? 具体点吗!

作者: xiexie11o   发布时间: 2011-09-24

2楼正解,稍微解释下可以吗! 好结贴啊

作者: xiexie11o   发布时间: 2011-09-24

没什么可解释的。。

你的select from biao select后面都为空怎么查询呢? 起码要加个字段。或者*

作者: jordan102   发布时间: 2011-09-24

是的哦! 现在出现随便什么数据都可以登陆.我闷!还是没有搞定!

作者: xiexie11o   发布时间: 2011-09-24

$sql=mysql_query("select * from biao where username='$laiu' and password='$laim'");
随便输入什么都登陆成功! 汗

作者: xiexie11o   发布时间: 2011-09-24

PHP code

<?php include_once conn.php";?>
<?php 
$laiu=$_POST["shangu"];
$laim=$_POST["shangm"];
$laim=md5($laim);//写数据库时候也用MD5了
$sql=mysql_query("select * from biao where username='$laiu' and password='$laim'");
if($sql){
    echo "登陆成功了";
}else{
    echo "o,shit";
    exit();
}
?>


这样呢。

作者: jordan102   发布时间: 2011-09-24

没有用!

作者: xiexie11o   发布时间: 2011-09-24

<?php include_once "conn.php";?> 少个引号吧。

作者: jordan102   发布时间: 2011-09-24

不用引用数据库文件.也可以插入数据! 真的不知道这是什么回事!

作者: xiexie11o   发布时间: 2011-09-24

热门下载

更多