I'm new for php mysql. I need help for developing my website. Actually, I'm using a open source loin script. and i put each file of this script in cpuser folder. But my website files are located in main root of web address. you can access my website by going to http://hdsweb.co.in/. and my user script can by accessed from http://hdsweb.co.in/cpuser/
in my script documentation a code was given to secure external pages and that was
<?php
include 'dbc.php';
page_protect();
?>
// place html or other php code below this.
But when i add this code in index file located outside cpuser folder. then i get this error.
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/hdswebco/public_html/index.php:3) in /home/hdswebco/public_html/cpuser/dbc.php on line 64
Warning: Cannot modify header information - headers already sent by (output started at /home/hdswebco/public_html/index.php:3) in /home/hdswebco/public_html/cpuser/dbc.php on line 113 .
So please help me how to add these code in a simple php based html template.
my page format is something like this
<!--Code to make script working-->
<?php
include 'cpuser/dbc.php';
page_protect();
?>
<!--Code ends-->
<html>
<head>
<title>Welcome to HDS Web | Now Find out the latest web techniques with us.</title>
</head>
<body>
<h1 align="left">HDS Web</h1>
<p align="right">
<?
if (isset($_SESSION['user_id'])) {?>
<div class="myaccount">
<p><strong>My Account</strong></p>
<a href="myaccount.php">My Account</a><br>
<a href="mysettings.php">Settings</a><br>
<a href="cpuser/logout.php">Logout </a>
</div>
<?
else {
// didn't login, show login link
echo '<p><a href="login.php">Login</a></p>';
} ?>
</body>
</html>
<? } ?>
And i want to show different my account menu for logged in users and for new user only a login link.. Thats why i tried to use a if and else feature but else feature is not inserted well.. SO please resolve all these problems...