You are here: Re: intersesting problem « All PHP « IT news, forums, messages
Re: intersesting problem

Posted by steve on 06/06/07 13:47

On Wed, 6 Jun 2007 04:49:58 +0800, Jeremy wrote
(in article <10k9i.417698$2Q1.386323@newsfe16.lga>):

> steve wrote:
>> Hi,
>>
>> I'm using php 5 zend and oracle.
>>
>>
>> I get a picture into the page using:
>>
>> <img src="dopic.php?image=REPLIC100450797">
>>
>>
>>
>> in my dopic.php , which incidentally took several days to get working.
>> I have:
>>
>>
>> <?php
>> //DO NOT ADD ANYTHING TO THIS OR REMOVE IT OR ELSE THE PICTURES WILL BREAK!!
>> //EVEN AN "INCLUDE" WILL MESS IT UP
>> //include('SitePHP/buildXHTML.php'); // our call out library
>>
>>
>> if (!isset($_GET['image'])) {
>> die();
>> }
>> else{
>> $image = $_GET['image'];
>> $db_conn = OCILogon("zzzzzzz", "zzzzzzzzz", "zzzzzzz");
>> if ( ! $db_conn ) {
>> echo "Unable to connect: " . var_dump( OCIError() );
>> die();
>> }
>> $cmdstr = "select THUMB_NAIL from MASTERS.PLUGS where
>> rep_index='".$image."'";
>> $parsed = OCIParse($db_conn, $cmdstr);
>> OCIExecute($parsed, OCI_DEFAULT);
>> // header ("Pragma: no-cache\n");
>> header("Content-type: image/jpg");
>> OCIFetch($parsed);
>> echo(ociresult($parsed, "THUMB_NAIL")->load());
>> OCILogoff($db_conn);
>>
>> }
>> ?>
>>
>>
>> but i find even if i add "include('SitePHP/buildXHTML.php'); " at the
>> start
>> of the code , then the routine stops working. ( no errors , but i suspect
>> the content is messed up, even if the include file is empty)
>>
>> any ideas
>>
>>
>>
>> Steve
>>
>>
>
> Is there ANY whitespace at all between the ?> tag and the end of the
> include file? If so, it will get output and screw up the image data.
>
> Make sure there is no whitespace anywhere outside of <?php...?>. Try
> removing the header() directive, and commenting out the echo command
> that spits out the image data. If you load the script in your browser
> and see anything at all besides a completely blank document, something
> is adding extra crap to the output.
>
> Jeremy

Hi,


I thought that crap only got into the output if I wrote it out, using echo
or print .

so are you saying that :
<?php
"a white space in here"
?>



Is enough to trigger the problem?

If so how the hell do you format your code nicely?

Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация