次のコードの問題点は何ですか?私を助けてください。私のPHPスクリプトで未定義の変数エラー
通常のユーザーのログインIDとパスワードとともにデータベースのadmin-idとパスワードを一致させ、それぞれのフォームにコントロールを転送したいと考えています。
お知らせ::私はこのコードを実行すると
は、それが次のエラーを与える未定義の変数を:CではuserStatus:\ xamppの\ htdocsに\ xamppの\テスト\ HRMS \ extract.phpを行に25
注意:未定義の変数:Cでのユーザタイプ:ラインで\ xamppの\ htdocsに\ xamppの\テスト\ HRMSの\ extract.php 30
$query1="select user_type,user_staus from `user_info` where name='$username' and
password='$password'";
$fetched=mysql_query($query1);
while($record=mysql_fetch_assoc($fetched))
{
while(each($record))
{
$usertype=$record["user_type"];
$userstatus=$record["user_staus"];
}//closing of 1st while loop
}//closing of 2nd while loop
if($userstatus==1) //if is logged in already
{
echo "Please login after some time";
exit();
}
if($usertype == 0) // if user is not an admin
{
$query1="select * from `user_info` where name='$username' and password='$password'";
$result = mysql_query($query1);
if(mysql_num_rows($result) == 1)
{
header("Location: user_form.php");
}
}
else if($usertype == 1) //if the user is a normal user
{
header("Location: admin_form.php");
}
else
{
echo "please register to login";
}
は、誰かが私には、問題を見つけることができますか?
phpの通知はエラーではありません。あなたの問題は他の場所にあります。 –
OPのコードの他の問題にかかわらず、Noticesは本当に解決することが重要です。今日の通知は明日の悪夢です。 –