physaux Posted October 16, 2009 Share Posted October 16, 2009 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! Link to comment https://forums.phpfreaks.com/topic/177939-solved-viewing-errors-in-captchaimagephp-how-if-it-only-sends-image/ Share on other sites More sharing options...
cags Posted October 16, 2009 Share Posted October 16, 2009 What error reporting do you have enabled? error_reporting(E_ALL); display_errors(1); Edit: D'oh that second line should obviously have been ini_set('display_errors', 1); Link to comment https://forums.phpfreaks.com/topic/177939-solved-viewing-errors-in-captchaimagephp-how-if-it-only-sends-image/#findComment-938185 Share on other sites More sharing options...
PFMaBiSmAd Posted October 16, 2009 Share Posted October 16, 2009 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); Link to comment https://forums.phpfreaks.com/topic/177939-solved-viewing-errors-in-captchaimagephp-how-if-it-only-sends-image/#findComment-938186 Share on other sites More sharing options...
physaux Posted October 16, 2009 Author Share Posted October 16, 2009 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!! Link to comment https://forums.phpfreaks.com/topic/177939-solved-viewing-errors-in-captchaimagephp-how-if-it-only-sends-image/#findComment-938198 Share on other sites More sharing options...
physaux Posted October 16, 2009 Author Share Posted October 16, 2009 Ok well i figured it out, i just accessed the image directly in my URL, right after the previous page loaded, preserving my session. I see many errors, and im off to more work! Link to comment https://forums.phpfreaks.com/topic/177939-solved-viewing-errors-in-captchaimagephp-how-if-it-only-sends-image/#findComment-938215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.