Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7953879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:15:40+00:00 2026-06-04T03:15:40+00:00

i am getting Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already

  • 0

i am getting Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at error

If i submit form data to a different file for processing, it works. But if i submit form data to the same page, it gives this error.

please suggst

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<title>Welcome</title>


<script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
$(document).ready(function () { 

    $('#nav li').hover(
        function () {
            //show its submenu
            $('ul', this).slideDown(100);

        }, 
        function () {
            //hide its submenu
            $('ul', this).slideUp(100);         
        }
    );

});
    </script>

</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="header">&nbsp;</td>
  </tr>
  <tr>
    <td class="menu"><table align="center" cellpadding="0" cellspacing="0" width="80%">
    <tr>
    <td>

    <ul id="nav">
    <li><a href="#">Catalog</a>
    <ul><li><a href="#">Products</a></li>
        <li><a href="#">Bulk Upload</a></li>
        </ul>
        <div class="clear"></div>
        </li>


    <li><a href="#">Purchase  </a>

    </li>
    <li><a href="#">Customer Service</a>
    <ul>
        <li><a href="#">Contact Us</a></li>
        <li><a href="#">CS Panel</a></li>

    </ul>           
        <div class="clear"></div>
    </li>
    <li><a href="#">All Reports</a></li>
    <li><a href="#">Configuration</a>
    <ul> <li><a href="#">Look and Feel </a></li>
         <li><a href="#">Business Details</a></li>
         <li><a href="#">CS Details</a></li>
         <li><a href="#">Emaqil Template</a></li>
         <li><a href="#">Domain and Analytics</a></li>
         <li><a href="#">Courier</a></li>
         </ul>
    <div class="clear"></div>
    </li>
    <li><a href="#">Accounts</a>
    <ul><li><a href="#">Ledgers</a></li>
        <li><a href="#">Account Details</a></li>
        </ul>
         <div class="clear"></div></li>

</ul></td></tr></table></td>
  </tr>
  <tr>
    <td valign="top"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td width="22%" height="327" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td>&nbsp;</td>
                </tr>
              <tr>
                <td height="45"><strong>-&gt; Products</strong></td>
                </tr>
              <tr>
                <td height="61"><strong>-&gt; Categories</strong></td>
                </tr>
              <tr>
                <td height="48"><strong>-&gt; Sub Categories</strong></td>
                </tr>
            </table></td>
            <td width="78%" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td>&nbsp;</td>
                </tr>
              <tr>
                <td>
                  <table width="90%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="26%">&nbsp;</td>
                      <td width="74%"><h2>Manage Categories</h2></td>
                    </tr>
                  </table></td>
                </tr>
              <tr>
                <td height="30">&nbsp;

                </td>
                </tr>
              <tr>
                <td>


</td>
                </tr>

                <tr>
                <td>
                <table width="49%" align="center" cellpadding="0" cellspacing="0">
                <tr><td>




<?php


                if (isset($_SESSION['error']))

                {

                    echo "<span id=\"error\"><p>" . $_SESSION['error'] . "</p></span>";

                    unset($_SESSION['error']);

                }

                ?>

                <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">

                <p>
                 <label class="style4">Category Name</label>

                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="categoryname" /><br /><br />

                    <label class="style4">Category Image</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                    <input type="file" name="image" /><br />

                    <input type="hidden" name="MAX_FILE_SIZE" value="100000" />

                   <br />
<br />
 <input type="submit" id="submit" value="UPLOAD" />

                </p>

                </form>




                             <?php

session_start();

require("includes/conn.php");


function is_valid_type($file)

{

    $valid_types = array("image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/png");



    if (in_array($file['type'], $valid_types))

        return 1;

    return 0;
}

function showContents($array)

{

    echo "<pre>";

    print_r($array);

    echo "</pre>";
}


$TARGET_PATH = "images/category";

$cname = $_POST['categoryname'];

$image = $_FILES['image'];

$cname = mysql_real_escape_string($cname);

$image['name'] = mysql_real_escape_string($image['name']);

$TARGET_PATH .= $image['name'];

if ( $cname == "" || $image['name'] == "" )

{

    $_SESSION['error'] = "All fields are required";

    header("Location: managecategories.php");

    exit;

}

if (!is_valid_type($image))

{

    $_SESSION['error'] = "You must upload a jpeg, gif, or bmp";

    header("Location: managecategories.php");

    exit;

}




if (file_exists($TARGET_PATH))

{

    $_SESSION['error'] = "A file with that name already exists";

    header("Location: managecategories.php");

    exit;

}


if (move_uploaded_file($image['tmp_name'], $TARGET_PATH))

{



    $sql = "insert into Categories (CategoryName, FileName) values ('$cname', '" . $image['name'] . "')";

    $result = mysql_query($sql) or die ("Could not insert data into DB: " . mysql_error());

  header("Location: mangaecategories.php");

    exit;

}

else

{





    $_SESSION['error'] = "Could not upload file.  Check read/write persmissions on the directory";

    header("Location: mangagecategories.php");

    exit;

}

?> 

Here is the code for Display

<?php  
                  require("includes/conn.php"); 



                $sql = "select CategoryID, CategoryName, FileName, Status from Categories";

                $result = mysql_query($sql) or die ("Could not access DB: " . mysql_error());



                while ($row = mysql_fetch_assoc($result))

                {

                     echo "<table border='0' cellpadding='10'>";


                                        echo "<tr><td>  </td><td>Category ID</td><td>Category Name</td><td>Status</td><td>Edit</td><td>Delete</td></tr>";

                                        echo "<tr><td> <img src=\"images/" . $row['FileName'] . "\" alt=\"\" /> </td>";
                                        echo "<td>". $row['CategoryID'] . "</td>";
                                            echo "<td>". $row['CategoryName'] . "</td>";
                                            echo "<td>". $row['Status']. "</td>";
                                            echo "<td> <a href= 'edit.php?CategoryID=" .$row['id']. "'> Edit </a></td>";
                                            echo "<td> <a href= 'delete.php?CategoryID=" .$row['id']. "'> Edit </a></td>";
                                         echo "</tr> </table>";

                }



            ?>

Nothing is happening here. Please suggest

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:15:42+00:00Added an answer on June 4, 2026 at 3:15 am

    You will find I have added the session_start() at the very top of the page. I have also removed the session_start() call later in the page. This page should work fine.

    <?php
    session_start();
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="style.css" rel="stylesheet" type="text/css" />
    <title>Welcome</title>
    
    
    <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript">
    $(document).ready(function () { 
    
        $('#nav li').hover(
            function () {
                //show its submenu
                $('ul', this).slideDown(100);
    
            }, 
            function () {
                //hide its submenu
                $('ul', this).slideUp(100);         
            }
        );
    
    });
        </script>
    
    </head>
    
    <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="header">&nbsp;</td>
      </tr>
      <tr>
        <td class="menu"><table align="center" cellpadding="0" cellspacing="0" width="80%">
        <tr>
        <td>
    
        <ul id="nav">
        <li><a href="#">Catalog</a>
        <ul><li><a href="#">Products</a></li>
            <li><a href="#">Bulk Upload</a></li>
            </ul>
            <div class="clear"></div>
            </li>
    
    
        <li><a href="#">Purchase  </a>
    
        </li>
        <li><a href="#">Customer Service</a>
        <ul>
            <li><a href="#">Contact Us</a></li>
            <li><a href="#">CS Panel</a></li>
    
        </ul>           
            <div class="clear"></div>
        </li>
        <li><a href="#">All Reports</a></li>
        <li><a href="#">Configuration</a>
        <ul> <li><a href="#">Look and Feel </a></li>
             <li><a href="#">Business Details</a></li>
             <li><a href="#">CS Details</a></li>
             <li><a href="#">Emaqil Template</a></li>
             <li><a href="#">Domain and Analytics</a></li>
             <li><a href="#">Courier</a></li>
             </ul>
        <div class="clear"></div>
        </li>
        <li><a href="#">Accounts</a>
        <ul><li><a href="#">Ledgers</a></li>
            <li><a href="#">Account Details</a></li>
            </ul>
             <div class="clear"></div></li>
    
    </ul></td></tr></table></td>
      </tr>
      <tr>
        <td valign="top"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td width="22%" height="327" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
                  <tr>
                    <td>&nbsp;</td>
                    </tr>
                  <tr>
                    <td height="45"><strong>-&gt; Products</strong></td>
                    </tr>
                  <tr>
                    <td height="61"><strong>-&gt; Categories</strong></td>
                    </tr>
                  <tr>
                    <td height="48"><strong>-&gt; Sub Categories</strong></td>
                    </tr>
                </table></td>
                <td width="78%" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>&nbsp;</td>
                    </tr>
                  <tr>
                    <td>
                      <table width="90%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="26%">&nbsp;</td>
                          <td width="74%"><h2>Manage Categories</h2></td>
                        </tr>
                      </table></td>
                    </tr>
                  <tr>
                    <td height="30">&nbsp;
    
                    </td>
                    </tr>
                  <tr>
                    <td>
    
    
    </td>
                    </tr>
    
                    <tr>
                    <td>
                    <table width="49%" align="center" cellpadding="0" cellspacing="0">
                    <tr><td>
    
    
    
    
    <?php
    
    
                    if (isset($_SESSION['error']))
    
                    {
    
                        echo "<span id=\"error\"><p>" . $_SESSION['error'] . "</p></span>";
    
                        unset($_SESSION['error']);
    
                    }
    
                    ?>
    
                    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
    
                    <p>
                     <label class="style4">Category Name</label>
    
                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="categoryname" /><br /><br />
    
                        <label class="style4">Category Image</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    
                        <input type="file" name="image" /><br />
    
                        <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
    
                       <br />
    <br />
     <input type="submit" id="submit" value="UPLOAD" />
    
                    </p>
    
                    </form>
    
    
    
    
                                 <?php
    
    
    require("includes/conn.php");
    
    
    function is_valid_type($file)
    
    {
    
        $valid_types = array("image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/png");
    
    
    
        if (in_array($file['type'], $valid_types))
    
            return 1;
    
        return 0;
    }
    
    function showContents($array)
    
    {
    
        echo "<pre>";
    
        print_r($array);
    
        echo "</pre>";
    }
    
    
    $TARGET_PATH = "images/category";
    
    $cname = $_POST['categoryname'];
    
    $image = $_FILES['image'];
    
    $cname = mysql_real_escape_string($cname);
    
    $image['name'] = mysql_real_escape_string($image['name']);
    
    $TARGET_PATH .= $image['name'];
    
    if ( $cname == "" || $image['name'] == "" )
    
    {
    
        $_SESSION['error'] = "All fields are required";
    
        header("Location: managecategories.php");
    
        exit;
    
    }
    
    if (!is_valid_type($image))
    
    {
    
        $_SESSION['error'] = "You must upload a jpeg, gif, or bmp";
    
        header("Location: managecategories.php");
    
        exit;
    
    }
    
    
    
    
    if (file_exists($TARGET_PATH))
    
    {
    
        $_SESSION['error'] = "A file with that name already exists";
    
        header("Location: managecategories.php");
    
        exit;
    
    }
    
    
    if (move_uploaded_file($image['tmp_name'], $TARGET_PATH))
    
    {
    
    
    
        $sql = "insert into Categories (CategoryName, FileName) values ('$cname', '" . $image['name'] . "')";
    
        $result = mysql_query($sql) or die ("Could not insert data into DB: " . mysql_error());
    
      header("Location: mangaecategories.php");
    
        exit;
    
    }
    
    else
    
    {
    
    
    
    
    
        $_SESSION['error'] = "Could not upload file.  Check read/write persmissions on the directory";
    
        header("Location: mangagecategories.php");
    
        exit;
    
    }
    
    ?> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting the following error when trying to start a session: Warning: session_start() [function.session-start]: Node
I'm getting the following warnings when trying to initiate a session: Warning: session_start() [function.session-start]:
I'm getting the following error: PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: open(/tmp/sess_49a20cbe1ef09a2d0262b3f7eb842e7b, O_RDWR) failed: Permission
I keep getting 'warning: control reaches end of non-void function' with this code: -
I'm using set_cookie() on a site. After adding some functionality, I'm getting Warning: Cannot
I'm getting this warning in my Output window (which doesn't affect functionality but I
When I am running this program I am getting warning array subscript has type
I am getting this warning from FxCop: 'RestartForm' contains field 'RestartForm.done' that is of
I'm getting a warning: Return makes pointer from integer without a cast for this
I am getting a warning I do not fully understand every time I run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.