romant Posted March 23, 2018 Share Posted March 23, 2018 Thank you very much for this great book!The only trouble I have is displaying CSS in chapter 18.No one php script in chapter 18 does display CSS style, except for index.html, it displays CSS like in examples in the book. I cannot understand why. For example, below is a source code generated from Script 18.5 - index.php, it does includes CSS style reference but doesn't display it in a browser. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Welcome to this Site!</title> <link rel="includes/layout.css"> </head> <body> <div id="Header">User Registration</div> <div id="Content"> <!-- End of Header --><h1>Welcome, roman!</h1><p>Spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam.</p> <p>Spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam spam.</p> <!-- Start of Footer --> </div><!-- Content --> <div id="Menu"> <a href="index.php" title="Home Page">Home</a><br> <a href="logout.php" title="Logout">Logout</a><br> <a href="change_password.php" title="Change Your Password">Change Password</a><br> <a href="#">Some Page</a><br> <a href="#">Another Page</a><br> </div><!-- Menu --> </body> </html> Link to comment Share on other sites More sharing options...
Larry Posted March 26, 2018 Share Posted March 26, 2018 Could you elaborate on what you mean by "doesn't display it in a browser"? Link to comment Share on other sites More sharing options...
romant Posted March 27, 2018 Author Share Posted March 27, 2018 I have attached two pictures showing index.php and register.php displaying in my browser (from chapter 18). https://imgur.com/59q0OhJ https://imgur.com/a/IJ67O Obviously, browser does not display css correctly, if we look at examples in ch 18 everything has different look from what I see. Link to comment Share on other sites More sharing options...
romant Posted March 27, 2018 Author Share Posted March 27, 2018 I guess this happens because of ob_start() function, but cannot understand exactly why. Link to comment Share on other sites More sharing options...
Larry Posted March 28, 2018 Share Posted March 28, 2018 Ah, okay. No, it probably doesn't have anything to do with the ob_start() function. It's most likely because the CSS page isn't being loaded. If you view the page source and click on the includes/layout.css link, your browser should take you to that page or, as I suspect, give you a 404. Link to comment Share on other sites More sharing options...
romant Posted March 28, 2018 Author Share Posted March 28, 2018 I added href tag and eventually it worked out. Thanks <link rel="stylesheet" href="layout.css"> Link to comment Share on other sites More sharing options...
Larry Posted March 28, 2018 Share Posted March 28, 2018 Cool. Kudos for figuring it out and thanks for sharing! Link to comment Share on other sites More sharing options...
Recommended Posts