Pitidd 0 Posted April 20, 2013 Report Share Posted April 20, 2013 Hi!I recently programmed a Websit and put it on XAMPP, only to see that the PHP include command responisble for the Website does'nt work.Here is the HTML: <!doctype html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width" /> <title>About me.</title> <link rel="stylesheet" href="style.css" /></head><body> <header> <h1>My Pages.</h1> </header> <?php require 'sidebar.php'; ?><div id="main" margin-top="5px"> <div id="ut"> <h2>Lorem Ipsum</h2> Dolor sit amet. </div> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas tincidunt sodales tellus et condimentum. Vestibulum ac magna ac enim venenatis porttitor vel a lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi placerat massa fermentum justo tempor in rutrum erat tempor. Phasellus tempus rhoncus odio, id mattis ipsum viverra id. Fusce in lectus vel dolor interdum laoreet. In ut mi velit. </div> </div></body></html> and here is the sidebar.php: <html><body><div id="sidesec">The Sidebar of Doom!<br>-------------------------<br><ul style="list-style-type: disc; text-align: left;"><li><a href="#">Home</a></li><li><a href="#">About me.</a></li></ul></div><div id="sidesec">Lorem Ipsum<br>dolor sit amet,</div></div>';?></body></html> I've tried it on multiple browsers now, but it does not show the sidebar. Please tell me what i'm doing wrong, as I have no more Idea what to try. Quote Link to post Share on other sites
jeffman 86 Posted April 20, 2013 Report Share Posted April 20, 2013 In the browser, view the source code. Where the included material should be, do you see: 1. nothing? Your path to the file is probably incorrect. 2. the <?php ?> tags? PHP is not enabled on your server, OR your shell document has an .html extension, and the server is configured only to parse PHP in files with a .php extension. FWIW, the include file does not need <html> and <body> tags, since the shell document already has them. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.