Hoặc là bạn cần đổi tên onlinestore.html
và
if[$count==1]
{
$_SESSION['logged']=true;
$_SESSION['username']=$myusername;
header["Location: onlinestore.html"];
exit[];
}
else
{
$_SESSION['logged']=false;
header["Location: login.html"];
exit[];
}
0 của mình thành các tệp .php để PHP sẽ hoạt động trong đó hoặc sử dụng tùy chọn addType trong tệp htaccess của bạn.Trong onlinestore.html
của bạn làm điều này:
Trong
if[$count==1]
{
$_SESSION['logged']=true;
$_SESSION['username']=$myusername;
header["Location: onlinestore.html"];
exit[];
}
else
{
$_SESSION['logged']=false;
header["Location: login.html"];
exit[];
}
2 của bạn làm điều này:
if[$count==1]
{
$_SESSION['logged']=true;
$_SESSION['username']=$myusername;
header["Location: onlinestore.html"];
exit[];
}
else
{
$_SESSION['logged']=false;
header["Location: login.html"];
exit[];
}
Nếu những điều trên không hoạt động thì xin vui lòng cho tôi biết điều gì sẽ xảy ra. Bạn có các tệp HTML được đặt thành mã PHP không? Hoặc một tệp htaccess với:
if[$count==1]
{
$_SESSION['logged']=true;
$_SESSION['username']=$myusername;
header["Location: onlinestore.html"];
exit[];
}
else
{
$_SESSION['logged']=false;
header["Location: login.html"];
exit[];
}
3?Do you have html files set to parse PHP code?
Or a htaccess file with:
if[$count==1]
{
$_SESSION['logged']=true;
$_SESSION['username']=$myusername;
header["Location: onlinestore.html"];
exit[];
}
else
{
$_SESSION['logged']=false;
header["Location: login.html"];
exit[];
}
3?
CHỈNH SỬA
Hãy thử điều này để gỡ lỗi:
Trong
if[$count==1]
{
$_SESSION['logged']=true;
$_SESSION['username']=$myusername;
header["Location: onlinestore.html"];
exit[];
}
else
{
$_SESSION['logged']=false;
header["Location: login.html"];
exit[];
}
2 của bạn làm điều này:Nếu những điều trên không hoạt động thì xin vui lòng cho tôi biết điều gì sẽ xảy ra. Bạn có các tệp HTML được đặt thành mã PHP không? Hoặc một tệp htaccess với:
if[$count==1]
{
$_SESSION['logged']=true;
$_SESSION['username']=$myusername;
header["Location: onlinestore.html"];
exit[];
}
else
{
$_SESSION['logged']=false;
header["Location: login.html"];
exit[];
}
3?CHỈNH SỬA
Hãy thử điều này để gỡ lỗi:
echo "This is working";
exit[];
if[$count==1]
{
$_SESSION['logged']=true;
$_SESSION['username']=$myusername;
echo "Login worked";
exit[];
}
else
{
$_SESSION['logged']=false;
echo "Login failed";
exit[];
}
- Hướng dẫn: Hiển thị tên người dùng sau khi đăng nhập vào PHP bằng mã nguồn
- Bắt đầu:
- Tạo cơ sở dữ liệu
- Tạo kết nối cơ sở dữ liệu
- Tạo giao diện
- Tạo chức năng chính
Hướng dẫn: Hiển thị tên người dùng sau khi đăng nhập vào PHP bằng mã nguồn
Bắt đầu:Display Username After Login using PHP. This code can display a username after the user login an account. The system uses the PHP POST method to call a specific function that can log in a user account using the SELECT query by validating the username and password if it exists. After login successful, the PHP SESSION will do its part by storing the user id temporarily, then querying it to the next page to display the user account user name.
Tạo cơ sở dữ liệuPHP as a scripting language and interpreter that is mainly used on any web server, including xamp, wamp, etc. It is being used to any popular websites, and it has a modern technology that can be easily used by the next generation.
Bắt đầu:
Tạo cơ sở dữ liệu//www.apachefriends.org/index.html.
Tạo kết nối cơ sở dữ liệu//getbootstrap.com/.
Tạo cơ sở dữ liệu
Tạo kết nối cơ sở dữ liệudb_user_login; after that, click Import, then locate the database file inside the folder of the application then click ok.
Sourcecodester