Jump to content

Php Coding help


Bill_needshelp
 Share

Recommended Posts

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

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

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

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

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 22
This 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>

Edited by MrFish
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...