Page 1 of 1

debug php code invoked by other php code

Posted: Sun Aug 16, 2009 4:12 am
by aneuryzma
How can I debug some php code which is invoked by other php files and not directly displayed in the html page ?

For example, this is the main php file:

Code: Select all

...
echo "hello" //it works
 
$html .= '" target="_blank"><img src="'.$mosConfig_live_site.'/plugins/content/plugin_jw_sig/showthumb.php?img='.$_images_dir_.'/'.$images[$a]['filename'].'&width='.$_width_.'&height='.$_height_.'&quality='.$_quality_.'"></a></div></div>';
 
//above it calls showthumb.php with some parameters
But if I place echo "hello" inside showthumb.php, I don't see the output

thanks

Re: debug php code invoked by other php code

Posted: Sun Aug 16, 2009 7:40 am
by jackpf
Just visit the page to see its output.

Don't send image headers though, or it just won't render.

Re: debug php code invoked by other php code

Posted: Sun Aug 16, 2009 8:52 am
by aneuryzma
I normally visit the page, but if the "echo" statement is in the invoked php file instead of the main one, nothing is displayed.

Re: debug php code invoked by other php code

Posted: Sun Aug 16, 2009 9:15 am
by jackpf
Yeah, visit the "invoked" page.

Re: debug php code invoked by other php code

Posted: Sun Aug 16, 2009 9:33 am
by aneuryzma
thanks