|
Posted by Jeremy on 06/05/07 20:49
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
Navigation:
[Reply to this message]
|