Jump to content

Edit news not showing


pspfreak101

Recommended Posts

I'm trying to build my admin panel on the index I have this included (don't know if thats causing it) but when I visit index.php?action=admin it displays my edit options fine but when I click on edit news I get please login in to access the admin panel, even if I have my session_start(); in my admin.php still doesn't work

 

Admin.php

<?php
//****************************************
//AppWarez 2008//
//****************************************
$loggedin = false;

if ($row["admin"] == "1") {
$loggedin = true;
} else {

echo "Please login to access the Administration Panel";

}

if ($loggedin == true) {

echo "Welcome <b>" . $_SESSION['username'] ." </b> the to Administration Panel";

echo "<li><a href=\"admin.php?action=editd\">Edit Download Entries</a></li>\n";
echo "<li><a href=\"admin.php?action=editm\">Edit Members</a></li>\n";
echo "<li><a href=\"admin.php?action=editn\">Edit News</a></li>\n";

if (@$_GET['action'] == 'editn') {

echo "<div align=\"center\" class=\"style1\">Submit News</div>\n";
echo "<form name=\"form1\" method=\"post\" action=\"submitn\">\n";
echo "Title:<input type=\"text\" name=\"news\" id=\"news\"><br />\n";
echo "Author: <b>" . $_SESSION['username'] . "</b> <br />\n";
echo "<label>Body\n";
echo "<textarea name=\"body\" id=\"body\" cols=\"50\" rows=\"8\" ></textarea></label>\n";
echo "<br />\n";
echo "<center><input type=\"Submit\" name=\"submit\" id=\"submit\" value=\"submit\"></center>\n";
echo "</form>\n";
  
   }
} //end loggedin


?>

Link to comment
https://forums.phpfreaks.com/topic/128971-edit-news-not-showing/
Share on other sites

ok Row admin comes from the database in the header.php like this

 

if(@$_SESSION['username']) {

$result = mysql_query("SELECT username, admin FROM users WHERE username = '".$_SESSION['username']."'", $con);

$row = mysql_fetch_array($result);

if ($row["admin"] == "1") {

echo " | <a href=\"http://www.hackingclan.com/Appwarez2/index.php?action=admin\">Admin</a>";

       }
}

 

Show I re-fetch it in the admin

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.