Support » Fixing WordPress » A way to see where PHP is rendered?

  • So there’s a gap in my knowledge of how wordpress works.

    It looks like wordpress is all php and that that php is run on the server, and then rendered out in html.

    What I’d like to know is if it is possible to see where that rendering is taking place, where the php gets executed and the html is generated.

    I’m trying to allow users to store and edit certain fields on the mysql database and it looks like the fields I’m currently using get this information as HTML and then somehow the HTML writes to the database and then …the php calls it up again? or…?

    I’m using the woo commerce plugin and I’m trying to understand how it writes information to the database and how it calls that info back up again so that I can adjust it as needed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • This is going to really just be a higher-level overview…
    “PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.”

    When a request hits a server (like a browser asking to see a certain page), the server notes the request for a PHP file and filters that request to the PHP processor which then runs through the PHP code of the requested file(s) and executes the PHP instructions. Often times these instructions make requests to a database table to fetch information. Once all the data has been collected, the PHP processor puts everything back together to create an HTML page that then gets sent by the server back to the user agent (server to browser: here’s the page you requested).

    Now saving data to a database requires at least three parts: an html form that has a specified form action, a server-side script that executes the form action, and, obviously, a database. So once a user has filled in the html form and clicks submit, the form-action triggers the server-side script to execute and take the data from the HTML form, put it into the appropriate format to execute a database query (or sends that info to another script/application which does this) and this information then gets sent to the database application to execute that query and save the data.

    So that’s a high-level overview of what’s happening.

    I see. It sounds like the PHP server-side script should then have SQL commands in it, to write new data to the database. Right?

    I am trying to find out which PHP file gathers the HTML data. In an example I found:

    <form method="post" action="claim.php" name="ClaimForm" id="ClaimForm" autocomplete="on">
            <legend>Contact Details</legend>
                <label for="firstname" accesskey="U">Your First Name</label>
                <input name="firstname" type="text" id="firstname" placeholder="Enter your name" required />


    In that first line it mentions the PHP file as claim.php However, the woocommerce plugin is missing that action field:

    <form method="post">
            Billing Address
        <p id="billing_country_field" class="form-row form-row-wide address-field update_totals_on_change validate-required"></p>
        <p id="billing_first_name_field" class="form-row form-row-first validate-required">
            <label class="" for="billing_first_name">
                First Name
                <abbr class="required" title="required">
            <input id="billing_first_name" class="input-text" type="text" value="John" placeholder="" name="billing_first_name"></input>


    My question then is how to hunt this down. It seems like the environment is working just as you say, but I can not trace it.

    the data is being sent to be processed by claim.php

    Claim.php is probably located in an include folder or something similar within woocommerce.

    I am sorry, I must have been unclear. The first code is an example that makes sense to me and how html data should be sent to php. The code I am using is the second set. In it, there is no “action=” part. Actually, the entire html code seems to not mention any php file. I do not know how to find out where the data is sent with my situation in the second code set. This second set is actually being written by woocommerce (not me) and is working.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘A way to see where PHP is rendered?’ is closed to new replies.