Questions about the main page displayed when PHP jumps from the login interface to the homepage

Source: Internet
Author: User
Problems with the main page when PHP jumps from the login interface to the homepage
Novice on the road, ask for answers! When I jump from login.html to homepage.html, how do i show "XXX welcome!" on the home page? ”。 I used a session, and then I read the data from the database.

------Solution--------------------

Session_Start ();
if (Isset ($_session[' user ')) echo $_session[' user '], ' welcome! ';

?>
------Solution--------------------
Jump from login.html to homepage.html you can't just jump to homepage.html, right?
Is there a php file in the middle of the check? Or did you just write the wrong two PHP files?
PHP file

Session_Start ();
echo $_session[' UserName '];//here is the name of the variable that you defined when login was detected
------Solution--------------------
Homepage.html is a static page, can you read the session?
------Solution--------------------
That's right.
Change your homepage.html to homepage.php

Explore

Homepage.html is a static page, can you read the session?
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.