Bill_needshelp Posted September 17, 2010 Share Posted September 17, 2010 If you have the following php, How do I get a new page that has the header and side navigation but would ignore the db for this new page, so I could use put just an image on that page. can I use css on this new page?<?include './config/config.php';include './libraries/output.php';include './libraries/siteDB.php';include './libraries/session.php';$dbConn = new siteDB;print_header("Home");?> Link to comment Share on other sites More sharing options...
Redroest Posted September 17, 2010 Share Posted September 17, 2010 Well, try to make a navigation structure in your website. For exampleindex.php <?phpinclude './config/config.php';include './libraries/output.php';include './libraries/session.php';if(!$_GET['page'] == 'picture'){ include './libraries/siteDB.php'; $dbConn = new siteDB;}else{ echo 'My image'; echo '<img src="image.png" alt="image" title="my image" />';}?> Link to comment Share on other sites More sharing options...
Bill_needshelp Posted September 18, 2010 Author Share Posted September 18, 2010 Tried above, however it caused the following errorsWarning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/www/123/index.php:2) in /home/www/123/libraries/session.php on line 22Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/www/123/index.php:2) in /home/www/123/libraries/session.php on line 22not sure? Link to comment Share on other sites More sharing options...
HungryMind Posted September 18, 2010 Share Posted September 18, 2010 Hi!Try Merge These Commands.<?phpob_start();// ALL YOUR PHP CODEob_flush();?> Link to comment Share on other sites More sharing options...
Bill_needshelp Posted September 18, 2010 Author Share Posted September 18, 2010 Hi!Try Merge These Commands.<?phpob_start();// ALL YOUR PHP CODEob_flush();?>Done this way it worked great.<?phpinclude './config/config.php';include './libraries/output.php';include './libraries/session.php';ob_start();// ALL YOUR PHP CODEob_flush();if(!$_GET['page'] == 'picture'){ include './libraries/siteDB.php'; $dbConn = new siteDB;}else{ echo 'My image'; echo '<img src="image.png" alt="image" title="my image" />';}?>Thank you.Is it possible to add a css gallery to this separate page, with subfolder css for gallery script, and subfolder for image for said gallery?Thanks Link to comment Share on other sites More sharing options...
MrFish Posted September 19, 2010 Share Posted September 19, 2010 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/www/123/index.php:2) in /home/www/123/libraries/session.php on line 22Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/www/123/index.php:2) in /home/www/123/libraries/session.php on line 22This is caused if the session_start() command comes after the html tags:Good-<?php session_start();?><html> <head></head> <body> ... ... Bad- <html> <head></head> <body> <?php session_start(); ?> </body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.