pspfreak101 Posted October 18, 2008 Share Posted October 18, 2008 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 ?> Quote Link to comment https://forums.phpfreaks.com/topic/128971-edit-news-not-showing/ Share on other sites More sharing options...
CroNiX Posted October 18, 2008 Share Posted October 18, 2008 wheres session_start() ? Quote Link to comment https://forums.phpfreaks.com/topic/128971-edit-news-not-showing/#findComment-668653 Share on other sites More sharing options...
pspfreak101 Posted October 18, 2008 Author Share Posted October 18, 2008 thats included on my index should I include that in admin to? Quote Link to comment https://forums.phpfreaks.com/topic/128971-edit-news-not-showing/#findComment-668694 Share on other sites More sharing options...
wildteen88 Posted October 18, 2008 Share Posted October 18, 2008 Where is the $row["admin"] variable set to? Also you do not need to call session_start in admin.php if its is being included into index.php Quote Link to comment https://forums.phpfreaks.com/topic/128971-edit-news-not-showing/#findComment-668696 Share on other sites More sharing options...
pspfreak101 Posted October 18, 2008 Author Share Posted October 18, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/128971-edit-news-not-showing/#findComment-668713 Share on other sites More sharing options...
pspfreak101 Posted October 18, 2008 Author Share Posted October 18, 2008 Ok I got it frogot to require some things thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/128971-edit-news-not-showing/#findComment-668718 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.