How do I follow the PHP call flows?

Hi Everybody,

I have a comments script built with PHP. It begins with an index.html document and I can not find the where or how this document makes any PHP calls. I have loaded this script to my host and it works just fine.
The issue I have is I would like to follow the “flow” of this simple script but can not find any points where the pages actually refer to running any of several PHP scripts.

Any suggestion to help me read these instructions in “order” will be appreciated.

Many thanks

Paul

In your index.html document, look for anything surrounded with <?php ?> tags; that’s your PHP.

If there isn’t any, look at any forms in the document: the action attribute should refer to another script, which is probably where your PHP is happening.

If there isn’t a link that way, your index.html script isn’t what’s running your PHP.

Unless your server was purposely configured to execute PHP in a .html file there is no PHP in there or that will do anything if there is.

There are many ways. The simplest is to put print commands at the start of <?php code of the files.

The better way if you want to watch the flow is to setup your IDE (such as Visual Code) for debugging using xdebug. This way you can single step and put break points at any location there is php code.

Here is a rather long article about ways to debug. A Detailed Guide to PHP Debugging – Stackify

In either case debugging in the IDE is an essential function to any development.

Sponsor our Newsletter | Privacy Policy | Terms of Service