mysql - PHP include database connection - cache limiter warning -
i have been trying resolve problem online solutions several days, , nothing helpful. missing key point on localhost works, when put online not.
error: warning: session_start(): cannot send session cache limiter - headers sent (output started @ /home/public_html/domain/index.php:1) in /home/public_html/domain/index.php on line 3
index.php
<?php session_start(); include('functions/connect.php'); $page = htmlentities($_get['page']); include('functions/' . $page . '.func.php'); $pages = scandir('pages'); if (!empty($page) && in_array($_get['page'] . '.php', $pages)) { $content = 'pages/' . $_get['page'] . '.php'; } else { header('location:index.php?page=register'); } if (isset($_session['uesername']) ) { header("location:index.php?page=member"); } ?> <!doctype html> <html> <head> <link href="css/mojcss.css" rel="stylesheet" type="text/css"/> </head> <body> <div id='content'> <?php include($content); ?> </div> </body> </html>
connect.php
<?php $link = @mysql_connect('localhost','myusername','mypass'); //or die('error'); if(!$link) { $message="<strong><font color='red'>error, try later.</font></strong><br /><br />"; die($message.mysql_error()); } $db = mysql_select_db('mydb'); //or die('unable connect'); if(!$db) { $message="<strong><font color='red'>error, try later.</font></strong><br /><br />"; die($message.mysql_error()); } ?>
check whether there session has been started on server preventing session_start() initialize.
Comments
Post a Comment