debug php code invoked by other php code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aneuryzma
Forum Contributor
Posts: 106
Joined: Sat May 17, 2008 7:03 am

debug php code invoked by other php code

Post 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
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: debug php code invoked by other php code

Post by jackpf »

Just visit the page to see its output.

Don't send image headers though, or it just won't render.
aneuryzma
Forum Contributor
Posts: 106
Joined: Sat May 17, 2008 7:03 am

Re: debug php code invoked by other php code

Post 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.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: debug php code invoked by other php code

Post by jackpf »

Yeah, visit the "invoked" page.
aneuryzma
Forum Contributor
Posts: 106
Joined: Sat May 17, 2008 7:03 am

Re: debug php code invoked by other php code

Post by aneuryzma »

thanks
Post Reply