Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.