Jump to content

herbiegrey

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

herbiegrey's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've tried that as it fixed an earlier problem i had, but it didn't fix this one. Anymore suggestions would be helpful.
  2. This didn't work as the layout file includes the commands to call the session file plus others. The admin_check is refering to the session file, so if you know the code that will link this function to the file directly then it may help?
  3. Hello, i'm new to php and phpfreaks, so hello! I've got a small error that you guys probably think is trivial. I'm working through a book i bought that is endorsed by phpfreaks, and it's called "creating interactive websites with php and web services" I've got two errors although i've followed the book exactly. [b]Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/fhlinux183/e/east-durham.co.uk/user/htdocs/admin/mod_news_category.php:1) in /home/fhlinux183/e/east-durham.co.uk/user/htdocs/includes/session.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /home/fhlinux183/e/east-durham.co.uk/user/htdocs/admin/mod_news_category.php:1) in /home/fhlinux183/e/east-durham.co.uk/user/htdocs/includes/session.php on line 4[/b] The lines 2 and 4 are on my session file and i can't see any errors in it  but i'll post the code. <?php session_start(); session_name('EastDurham'); header("Cache-control: private"); // fix for IE function login_check(){ if($_SESSION['login'] !=TRUE){ myheader("Login Required"); include $_SERVER['DOCUMENT_ROOT']. '/html/forms/login_form.html'; footer(); exit(); } } function admin_check(){     if($_SESSION['admin_access'] != TRUE){       myheader("Access Denied!");       echo "<center>This area is restricted".             " for website administrators!";       footer();       exit();   } } ?> here is the code of the page that the error appears on <?php include $_SERVER['DOCUMENT_ROOT'].         '/layout.php'; // Quick Admin session check  admin_check(); // Dynamic Form Select Menu // For Categories function cat_list($selected){   // Perform the query   $sql = mysql_query("SELECT * FROM           news_categories");     // Begin select menu          echo "<select name=\"cat_id\">\n";   echo "<option value=\"NULL\">Please Select</option>\n";     // Do the loop for the categories   while($row = mysql_fetch_array($sql)){         echo "<option value=\"".         stripslashes($row[cat_id])."\"";                 // if $selected is equal         // to current row, select         // this item in menu.                 if($selected == $row[cat_id]){             echo "selected";         }                 echo ">".stripslashes($row[cat_name]).         "</option>\n";   }   // Close select statement   echo "</select>\n"; } // Initiate myheader function myheader("Modify or Delete News Categories"); // Start switch switch($_REQUEST['req']){     // Modify category form   case "mod_category":       $sql = mysql_query("SELECT * FROM             news_categories WHERE             cat_id='{$_POST['cat_id']}'");                         $row = mysql_fetch_assoc($sql);                         include $_SERVER['DOCUMENT_ROOT'].             '/html/forms/mod_news_category_form.html';   break;     // Modify category query   case "update_category":       $sql = mysql_query("UPDATE news_categories             SET cat_name='{$_POST['cat_name']}',             cat_description='{$_POST['cat_description']}'             WHERE cat_id='{$_POST['cat_id']}'") or die (mysql_error());                   if(!$sql){           echo "Error performing query: ".                 mysql_error();       } else {         echo '<p align="center">Category Updated!</p>';         echo '<p align="center">'.               '<a href="/admin/mod_news_category.php">'.               'Modify Another Category</a>';       }   break;     // Delete category confirmation   case "del_category":       echo '<p align="center">Are you sure '.           'you want to delete this category?'.           '</p>';           echo '<p align="center">'.           '<a href="/admin/mod_news_category.php?req=delete_category&amp;cat_id='           .$_POST['cat_id'].'">Yes</a>  '.           '| <a href="/admin/mod_news_category.php">No</a></p>';   break;     // Delete category query   case "delete_category":       $sql = mysql_query("DELETE FROM news_categories             WHERE cat_id='{$_REQUEST['cat_id']}'");                   if(!$sql){         echo 'Error performing DELETE query: '.               mysql_error();       } else {         echo '<p align="center">Category Deleted!</p>';         echo '<p align="center">'.               '<a href="/admin/mod_news_category.php">'.               'Modify another category</a></p>';       }   break;     // Modify and Delete category forms   default:       include $_SERVER['DOCUMENT_ROOT'].               '/html/forms/mod_news_category_index.html';   break; } // Footer footer(); ?> thanks in advance
×
×
  • 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.