Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > intersesting problem
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 12th March 23:59
steve
External User
 
Posts: 1
Default intersesting problem


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
  Reply With Quote


  sponsored links


2 12th March 23:59
jeremy
External User
 
Posts: 1
Default intersesting problem


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 do***ent, something
is adding extra crap to the output.

Jeremy
  Reply With Quote
3 13th March 02:44
steve
External User
 
Posts: 1
Default intersesting problem


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
  Reply With Quote
4 13th March 02:44
geoff berrow
External User
 
Posts: 1
Default intersesting problem


Message-ID: <f46dte02t0p@news2.newsguy.com> from steve contained the
following:

No. White space /outside/ the <?php ...?>

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666