且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Muliple类型用户在PHP中的相同表单上登录

更新时间:2023-12-03 20:31:35

_POST ['submit']){

ob_start();


id =


_POST ['id'];

<?php
if(isset($_POST['submit']) {
ob_start();
$id=$_POST['id'];
$pswd=$_POST['pswd'];

$sql="SELECT * FROM admin WHERE id=........."
$query=mysql_query($sql);
$count=mysql_num_rows($query);
if($count==1) {
header('location: admin/index.php');
} else {
$sql="SELECT * FROM user WHERE id=........."
$query=mysql_query($sql);
$count=mysql_num_rows($query);
if($count==1) {
header('location: user/index.php');
} else {
echo 'Invalid id-password combination';
}
}
}
?>

is any errors on this code???

What I have tried:

help me pleaseeeeeeeeeeeeeeeee

_POST['submit']) {
ob_start();


id=


_POST['id'];