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 8789093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:18:25+00:00 2026-06-13T22:18:25+00:00

I have a PHP code . when i run the code , it works

  • 0

I have a PHP code . when i run the code , it works properly but there appears some warnings , that is –Warning: Cannot modify header information - headers already sent by (output started at /home/fundumob/public_html/app_create/nav_class.php:119) in /home/fundumob/public_html/app_create/profile.php on line 32

what can i do ??? ,my code is given below..

 <?php session_start(); error_reporting(E_ALL ^ E_WARNING);?>
 <?php
  //include("local_config.php");
  include("lib/config.php");
  include("nav_class.php");
  $obj=new navig();

  if(isset($_SESSION['user_id']))
  {
  $user_id=$_SESSION['user_id'];
  $pic="select Picture from Profile where user_id=$user_id ";
  $pic_result=mysql_query($pic) or die ("sorry".$pic);
  $count=mysql_num_fields($pic_result);

  if($count==1)
  {

   $rows=mysql_fetch_row($pic_result);

   $_SESSION['picture']=$rows[0];
   $profile_pic=$_SESSION['picture'];

   $photo="profile/".$profile_pic;
    }
   else
   {
    $photo="profile/img.jpg";
   }
   }
   else
   {
   header("location:index.php?er=3");
    }

    ?>

   <div id="templatemo_header_wrapper">

<div id="templatemo_header">

    <div id="site_logo"></div>


      <div id="menu_nav" >
    <ul id="css3menu1" class="topmenu">
    <li class="topfirst"><a href="profile.php?apps=1" style="height:15px;line-
     height:15px;">Dashboard</a></li>
     <li class="topmenu"><a href="#" style="height:15px;line-height:15px;">Profile</a>      
       </li>
  <li class="topmenu"><a href="#" style="height:15px;line-height:15px;">Settings</a>  
   </li>
  <li class="toplast"><a href="#" style="height:15px;line-height:15px;">Prateek    

</ul>
</div>  </div><!-- end of header -->
 </div>

  <div id="tempatemo_content_wrapper">

   <div id="templatemo_content" align="center">

    <div class="recent_projects">

          <div align="right">
           <table width="50%" border="0">
           <tr>
           <td width="85%" height="20" style="border-right:1px solid #D0D0D0;"><div    
         align="right">Welcome&nbsp;&nbsp;&nbsp;<?php echo $_SESSION['fname']."&nbsp;". 
      $_SESSION['lname']; ?></div></td>
           <td width="15%" > <div align="center"><a href="logout.php">Log Out</a></div>
          </td>
           </tr>
           </table>
          </div>

    </div>
  <!--end of recent project-->  
  • 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-13T22:18:26+00:00Added an answer on June 13, 2026 at 10:18 pm

    Ugly, ugly code….

    <?php
    
    @session_start();
    error_reporting(E_ALL ^ E_WARNING);
    
    //include("local_config.php");
    include( 'lib/config.php' );
    include( 'nav_class.php' );
    
    $obj = new navig();
    
    if( !isset( $_SESSION['user_id'] ) ){
    
      if( !headers_sent() )
        header( 'Location: index.php?er=3' );
      echo '<script type="text/javascript">document.location.href="index.php?er=3";</script>';
      die();
    
    }
    
    $photo = 'profile/img.jpg';
    
    if( !isset( $_SESSION['picture'] ) ){
    
      $user_id = (int) $_SESSION['user_id'];
      $pic = "SELECT Picture FROM Profile WHERE user_id=$user_id";
    
      if( ( $pic_result = mysql_query( $pic ) ) && mysql_num_rows( $pic_result )==1 ){
        $row = mysql_fetch_row( $pic_result );
        $_SESSION['picture'] = $row[0];
        $photo = 'profile/'.$row[0];
      }
    
    }else{
    
      $photo = 'profile/'.$_SESSION['picture'];
    
    }
    
    ?>
    
    <div id="templatemo_header_wrapper">
      <div id="templatemo_header">
        <div id="site_logo"></div>
        <div id="menu_nav">
          <ul id="css3menu1" class="topmenu">
            <li class="topfirst"><a href="profile.php?apps=1" style="height:15px;line-height:15px;">Dashboard</a></li>
            <li class="topmenu"><a href="#" style="height:15px;line-height:15px;">Profile</a></li>
            <li class="topmenu"><a href="#" style="height:15px;line-height:15px;">Settings</a></li>
            <li class="toplast"><a href="#" style="height:15px;line-height:15px;">Prateek</li>
          </ul>
        </div>
      </div><!-- end of header -->
    </div>
    
    <div id="tempatemo_content_wrapper">
      <div id="templatemo_content" align="center">
        <div class="recent_projects">
          <div align="right">
            <table width="50%" border="0">
              <tr>
                <td width="85%" height="20" style="border-right:1px solid #D0D0D0;"><div align="right">Welcome&nbsp;&nbsp;&nbsp;<?php echo $_SESSION['fname'].'&nbsp;'.$_SESSION['lname']; ?></div></td>
                <td width="15%" ><div align="center"><a href="logout.php">Log Out</a></div></td>
              </tr>
            </table>
          </div>
        </div>
        <!--end of recent project-->
    
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP code, that will run a Select query to check if
I have php code that puts some values into an Array as follows: $hunter=addslashes($MessageArray[1]);
I have some PHP code that generates dynamic tables of data on the fly.
I have some PHP code that is designed to make a spreadsheet with formulas
I have some PHP code that generates a calendar and then outputs html to
I have a PHP script that works by calling items from a database based
I have a PHP script in my Code Igniter application, its run on server
I have the following php code set to run as a CRON job. It
I am getting varied results with some PHP code I have written to upload
I have the following PHP code that uses cURL: $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,http://area51.stackexchange.com/users/flair/31.json); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);

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.