[英]PHP file display blank page
I'm writing 'log in' script with this code: 我正在使用以下代码编写“登录”脚本:
blah blah
<?php
require_once("polaczenie.php");
$login=$_POST["email_post"];
$haslo=$_POST["haslo"];
$link=mysql_query("SELECT * FROM uzytkownicy WHERE email='$login'") or die(mysql_error());
$wiersz=mysql_fetch_array($link);
$login_baza=$wiersz["email"];
$haslo_baza=$wiersz["haslo"];
$imie=$wiersz["imie"];
$nazwisko=$wiersz["nazwisko"];
$adres=$wiersz["adres"];
$telefon=$wiersz["telefon"];
$nazwa_firmy=$wiersz["nazwa_firmy"];
$strona_www=$wiersz["strona_www"];
$typ_konta=$wiersz["typ_konta"];
if(($login_baza==$login)&($haslo_baza==$haslo)){
$_SESSION["zalogowany"] = 'ok';
$_SESSION["email"] = $login;
$_SESSION["imie"] = $imie;
$_SESSION["nazwisko"] = $nazwisko;
$_SESSION["adres"] = $adres;
$_SESSION["telefon"] = $telefon;
$_SESSION["nazwa_firmy"] = $nazwa_firmy;
$_SESSION["strona_www"] = $strona_www;
$_SESSION["typ_konta"] = $typ_konta;
echo 'ok';
} else {
echo 'no ok';
}
};
?>
Everything that I receive it blank page, even without 'blah blah' at the top. 我收到的所有内容都是空白页,即使顶部没有'blah blah'。 What is wrong with it? 怎么了 Anyway, thank you for your help ;) 无论如何,谢谢您的帮助;)
if(($login_baza==$login)&($haslo_baza==$haslo)){
should be 应该
if(($login_baza==$login) && ($haslo_baza==$haslo)){
Also make sure you have 同时确保你有
session_start()
on the top of the page !! session_start()
在页面顶部!
Also you have an extra } ;
另外你还有一个} ;
at the end 在末尾
Maybe because your page doesn't display errors. 可能是因为您的页面没有显示错误。
add this to your script : 将此添加到您的脚本中:
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
ini_set('display_errors', 1);
//your script
you have some errors like : 您有一些错误,例如:
if(($login_baza==$login)&($haslo_baza==$haslo))
should be : 应该 :
if(($login_baza==$login) && ($haslo_baza==$haslo))
and there is no };
而且没有};
at the bottom. 在底部。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.