RE: Query - Warning: Cannot modify header information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
 
i checked the line before 61...
it sends the image content type this is the code of image.php
 
 
<?php
/*****************************************************************************\
+-----------------------------------------------------------------------------+
| X-Cart                                                                      |
| Copyright (c) 2001-2005 Ruslan R. Fazliev <rrf@xxxxxx>                      |
| All rights reserved.                                                        |
+-----------------------------------------------------------------------------+
| PLEASE READ  THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" |
| FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE  |
| AT THE FOLLOWING URL: http://www.x-cart.com/license.php                     |
|                                                                             |
| THIS  AGREEMENT  EXPRESSES  THE  TERMS  AND CONDITIONS ON WHICH YOU MAY USE |
| THIS SOFTWARE   PROGRAM   AND  ASSOCIATED  DOCUMENTATION   THAT  RUSLAN  R. |
| FAZLIEV (hereinafter  referred to as "THE AUTHOR") IS FURNISHING  OR MAKING |
| AVAILABLE TO YOU WITH  THIS  AGREEMENT  (COLLECTIVELY,  THE  "SOFTWARE").   |
| PLEASE   REVIEW   THE  TERMS  AND   CONDITIONS  OF  THIS  LICENSE AGREEMENT |
| CAREFULLY   BEFORE   INSTALLING   OR  USING  THE  SOFTWARE.  BY INSTALLING, |
| COPYING   OR   OTHERWISE   USING   THE   SOFTWARE,  YOU  AND  YOUR  COMPANY |
| (COLLECTIVELY,  "YOU")  ARE  ACCEPTING  AND AGREEING  TO  THE TERMS OF THIS |
| LICENSE   AGREEMENT.   IF  YOU    ARE  NOT  WILLING   TO  BE  BOUND BY THIS |
| AGREEMENT, DO  NOT INSTALL OR USE THE SOFTWARE.  VARIOUS   COPYRIGHTS   AND |
| OTHER   INTELLECTUAL   PROPERTY   RIGHTS    PROTECT   THE   SOFTWARE.  THIS |
| AGREEMENT IS A LICENSE AGREEMENT THAT GIVES  YOU  LIMITED  RIGHTS   TO  USE |
| THE  SOFTWARE   AND  NOT  AN  AGREEMENT  FOR SALE OR FOR  TRANSFER OF TITLE.|
| THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT.      |
|                                                                             |
| The Initial Developer of the Original Code is Ruslan R. Fazliev             |
| Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2005           |
| Ruslan R. Fazliev. All Rights Reserved.                                     |
+-----------------------------------------------------------------------------+
\*****************************************************************************/
#
# $Id: image.php,v 1.28.2.1 2005/01/12 07:41:42 svowl Exp $
#
# Show image by productid
#
require "./top.inc.php";
require "./config.php";
if (empty($productid)) $productid = "";
$image_out = ""; $image_type = ""; $image_path = "";
if (!empty($tmp)) {
    x_session_register("file_upload_data");
    if (!empty($file_upload_data["file_path"]) && $file_upload_data["id"]==$productid && $file_upload_data["imtype"]=="T") {
  $image_out = func_file_get($file_upload_data["file_path"], true);
    }
}
if (empty($image_out)) {
 if(!empty($variantid))
  $result = db_query("SELECT image, image_path, image_type FROM $sql_tbl[thumbnails] WHERE productid='$productid' AND variantid = '$variantid'");
 if(empty($result))
  $result = db_query("SELECT image, image_path, image_type FROM $sql_tbl[thumbnails] WHERE productid='$productid' AND variantid = ''");
 if (db_num_rows($result))
  list($image, $image_path, $image_type) = db_fetch_row($result);
 else {
  header("Content-type: image/gif");
  func_readfile($default_image, true);
  exit;
 }
 db_free_result($result);
 if ($config["Images"]["thumbnails_location"] == "DB") {
     if (!empty($image))
         $image_out = $image;
     else
         $no_image_db = true;
 } 
 
 if ($config["Images"]["thumbnails_location"] == "FS" || !empty($no_image_db)) {
     if (!empty($image_path)) { 
   header("Content-type: $image_type");
         func_readfile($image_path, true);
   exit;
     }
 }
}
if (!empty($image_out)) {
 header("Content-type: $image_type");
 echo $image_out;
} else {
 header("Content-type: image/gif");
 func_readfile($default_image, true);
}
?>

 
------------------------
 
plz check it and give some valuable sugguesion to me.
 
thanks..........


George Pitcher <george.pitcher@xxxxxxxxxxx> wrote:
This looks as though you are trying to send header() after something has
been output to screen. Check your code before line 61.

George

> -----Original Message-----
> From: Suresh Pandian [mailto:suresh_july09@xxxxxxxxxxx]
> Sent: 30 September 2005 7:47 am
> To: php-general@xxxxxxxxxxxxx
> Subject:  Query - Warning: Cannot modify header information
>
>
> Hi friends,
>
> i am currently redesign th x-cart site. ichanged the template
> files into my concern. i received some warnings like this..
>
> Warning: Cannot modify header information - headers already sent
> by (output started at /home/gift1/public_html/home.php:2) in
> /home/gift1/public_html/referer.php on line 61
>
>
>
>
>
> The images in the database also not displayed.but, i didnot
> change anything in the image.php.
>
>
>
> how can i solve this .....i need help asap
>
>
> ---------------------------------
> Yahoo! India Matrimony: Find your partner now.



		
---------------------------------
 Yahoo! India Matrimony: Find your partner now.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux