Jump to content

[SOLVED] Viewing Errors in CaptchaImage.php// how, if it only sends image?


physaux

Recommended Posts

Hello again guys, this time i have heavily modded my captcha.php file, and when i refer to it as such:

 

echo '<img src="captchaimage.php />';

 

My image doesn't come out normally... Which is predictable, But i do not see any errors on screen, i just want to be able to see the errors that this page generates, because it must have some.

 

So does anybody know how i can do this? Thanks!

You need to temporarily disable the Content-type: header (comment it out.) You might also need to turn on full php error_reporting/display_errors by adding the following two lines of code immediately after your first opening php tag in captchaimage.php -

 

ini_set("display_errors", "1");
error_reporting(E_ALL);

i have

ini_set('display_errors',1);

error_reporting(E_ALL);

 

in both files, right under first line, which has <?php tag as you said.

 

However i still am not seeing any errors. Here i am going to show you summarized code of the captchaimage.php file:

 

<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
session_start();

$OrderOfOperations = $_SESSION["OrderOfOperations"];
$ImageFormat= $_SESSION["ImageFormat"];
$printcoordinates= array();

class Blogfarmimage {
function Blogfarmimage($width,$height) {
	$image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
	//...
	header('Content-Type: image/jpeg');
	imagejpeg($image);
	imagedestroy($image);
}

}

if(isset($OrderOfOperations)){
//...	
$captcha = new <strong>Blogfarmimage</strong>($width,$height);
}

?>

 

And it is called from index.php with:

echo '<img src="captchaimage.php />';

 

Any clue how i could make this show me errors?

Maybe viewing errorlogs? (if so could you please tell me how to do that)

 

thanks!!

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.