View Full Version : Simple News HELP
Jamieb
03-10-2007, 04:38 PM
On all the files like the one were u show news.. i change the font and it comes up with a error :S whys???
Eccentric
03-10-2007, 04:40 PM
is it in an echo? and wat error?
Jamieb
03-10-2007, 04:41 PM
this is the error when i skin the admin zone.
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/jamie/public_html/backend/files/index.php:2) in /home/jamie/public_html/backend/files/connect.php on line 2
Eccentric
03-10-2007, 04:42 PM
post the coding... :)
Jamieb
03-10-2007, 04:43 PM
<div id="top">
<img border="0" src="top_logo.jpg" width="288" height="131"></div>
<div id="fade">
<!-- Empty -->
</div>
<center>
Welcome to the Backend!<br />
<br />
<?php include 'connect.php';
if ($_SESSION['username'] && $_SESSION['level'] == 1 ) {
echo ("
<strong>Navigation</strong><br />
<br />
<a href=\"add_news.php\">Add An Article</a> <br />
<a href=\"logout.php\">Logout</a> <br />");
}
elseif ($_SESSION['username'] && $_SESSION['level'] == 2 ) {
echo ("
<strong>Navigation</strong><br />
<br />
<a href=\"add_news.php\">Add An Article</a> <br />
<a href=\"delete_news.php\">Delete An Article</a> <br />
<a href=\"register_account.php\">Create A New User</a> <br />
<a href=\"/upload/backend.php\">Acsept Images</a> <br />
<a href=\"logout.php\">Logout</a> <br />");
}
else {
echo ("Please login");
}
php?>
</center>
</div>
<p align="center"> </p>
</body></html>
Eccentric
03-10-2007, 04:54 PM
i dont see any added font?
The error means the session in index.php was already started in connect.php which is included into index.php
Jamieb
03-10-2007, 05:30 PM
How do i fix?
Eccentric
03-10-2007, 05:31 PM
dont set the session on the config file? :S
Jamieb
03-10-2007, 05:33 PM
there aint a config.php :S
thats connect php :S
<?php
session_start();
$dbname = "jamie_cms";
$dbuser = "jamie_cms";
$dbpass = "cms";
mysql_connect ("localhost", $dbuser, $dbpass) or die ("Couldnt connect");
mysql_select_db ($dbname) or die ("Invalid Database name");
?>
Eccentric
03-10-2007, 05:35 PM
connect.php even :D
Invent
03-10-2007, 05:35 PM
Uhm, Caleb's panel named simpleNEWS isn't out yet and you were posting in HIS thread about this error?
Can you post the link to the panel which you are using? :confused:
redtom
03-10-2007, 05:48 PM
Uhm, Caleb's panel named simpleNEWS isn't out yet and you were posting in HIS thread about this error?
Can you post the link to the panel which you are using? :confused:
Hes using mine, I think I know what the problem is let me check, I'll edit this post in a second.
EDIT:
<?php include 'connect.php'; ?>
<div id="top">
<img border="0" src="top_logo.jpg" width="288" height="131"></div>
<div id="fade">
<!-- Empty -->
</div>
<center>
Welcome to the Backend!<br />
<br />
<?php
if ($_SESSION['username'] && $_SESSION['level'] == 1 ) {
echo ("
<strong>Navigation</strong><br />
<br />
<a href=\"add_news.php\">Add An Article</a> <br />
<a href=\"logout.php\">Logout</a> <br />");
}
elseif ($_SESSION['username'] && $_SESSION['level'] == 2 ) {
echo ("
<strong>Navigation</strong><br />
<br />
<a href=\"add_news.php\">Add An Article</a> <br />
<a href=\"delete_news.php\">Delete An Article</a> <br />
<a href=\"register_account.php\">Create A New User</a> <br />
<a href=\"/upload/backend.php\">Acsept Images</a> <br />
<a href=\"logout.php\">Logout</a> <br />");
}
else {
echo ("Please login");
}
php?>
</center>
</div>
<p align="center"> </p>
</body></html>
Try that.
Jamieb
03-10-2007, 05:50 PM
Yh tom its your i think.. can u help plz
redtom
03-10-2007, 05:51 PM
Yh tom its your i think.. can u help plz
Check my post I just edited it.
Jamieb
03-10-2007, 05:52 PM
Its moved and it says this at the top of ma page now
Warning: session_start() [function.session-start (http://jamie.able-host.com/backend/files/function.session-start)]: Cannot send session cache limiter - headers already sent (output started at /home/jamie/public_html/backend/files/index.php:2) in /home/jamie/public_html/backend/files/connect.php on line 2
redtom
03-10-2007, 05:56 PM
Its moved and it says this at the top of ma page now
Warning: session_start() [function.session-start (http://jamie.able-host.com/backend/files/function.session-start)]: Cannot send session cache limiter - headers already sent (output started at /home/jamie/public_html/backend/files/index.php:2) in /home/jamie/public_html/backend/files/connect.php on line 2
Okay...
So place this at the very top of the page, above everything:
<?php include 'connect.php'; ?>
And then heres the code you had before but with out the include to the connect, place it where you want:
<div id="top">
<img border="0" src="top_logo.jpg" width="288" height="131"></div>
<div id="fade">
<!-- Empty -->
</div>
<center>
Welcome to the Backend!<br />
<br />
<?php
if ($_SESSION['username'] && $_SESSION['level'] == 1 ) {
echo ("
<strong>Navigation</strong><br />
<br />
<a href=\"add_news.php\">Add An Article</a> <br />
<a href=\"logout.php\">Logout</a> <br />");
}
elseif ($_SESSION['username'] && $_SESSION['level'] == 2 ) {
echo ("
<strong>Navigation</strong><br />
<br />
<a href=\"add_news.php\">Add An Article</a> <br />
<a href=\"delete_news.php\">Delete An Article</a> <br />
<a href=\"register_account.php\">Create A New User</a> <br />
<a href=\"/upload/backend.php\">Acsept Images</a> <br />
<a href=\"logout.php\">Logout</a> <br />");
}
else {
echo ("Please login");
}
php?>
</center>
</div>
<p align="center"> </p>
</body></html>
Jamieb
03-10-2007, 06:01 PM
Ty but when i edit the font it says this
Warning: session_start() [function.session-start (http://jamie.able-host.com/backend/function.session-start)]: Cannot send session cache limiter - headers already sent (output started at /home/jamie/public_html/backend/index.php:1) in /home/jamie/public_html/backend/files/connect.php on line 2
News
Test - id:3
Enter your article here...kk
Poested By: admin
whats happend.. and how do i remver the ID aswell...
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
}
-->
</style>
<?php include 'files/connect.php';
echo ("<strong>News</strong><br /><br />");
$result =
mysql_query("select * from news order by id desc");
while($row = mysql_fetch_array($result))
{
$title=$row["title"];
$user=$row["by"];
$body=$row["body"];
$id=$row["id"];
echo
"<strong>$title</strong> - id:<italic>$id</italic><br />
$body<br />
Poested By: $user<br />
<br />";
}
php?>
thats the code..
redtom
03-10-2007, 06:45 PM
You still haven't moved the include.
<?php include 'files/connect.php'; ?>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
}
-->
</style>
<?php
echo ("<strong>News</strong><br /><br />");
$result =
mysql_query("select * from news order by id desc");
while($row = mysql_fetch_array($result))
{
$title=$row["title"];
$user=$row["by"];
$body=$row["body"];
$id=$row["id"];
echo
"<strong>$title</strong> <br />
$body<br />
Poested By: $user<br />
<br />";
}
php?>
Use that ^
Jamieb
03-10-2007, 06:59 PM
Ty +rep
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.