tags:

views:

49

answers:

1

In my below given code, the second DIV section is not executing. The PHP code contained therein is not executing. I added a test echo, but it is not displaying it also. Why the control is not reaching there.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
<html>
    <head>
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <title>Add/Update Election Category</title>
     <link rel="stylesheet" href="../Lib/entryformstyle.css" type="text/css"/>

    </head>
    <body>
     <div id="sectionEntryForm" class="entryForm" style="width:300px"> <!-- Begin of Entry Form Section -->
      <form action="electioncategorymaster.php" method="post" id="frmElectionCategoryMaster" name="frmElectionCategoryMaster">
       <table id="tblEntryForm" cols="3" class="entryFormTable">
        <tr bgcolor="white">
         <td colspan="3" align="center">Add / Update Election Category</td>
        </tr>
        <tr>
         <td>Election category name:</td>
         <td colspan="2"><input id="inElectionCategoryName" name="inElectionCategoryName" accept="text/plain" maxlength="80" class="entryFormInputBoxColorCompulsoryField" size="40"></td>
        </tr>
        <tr>
         <td>Total members:</td>
         <td colspan="2"><input id="inTotalMembers" name="inTotalMembers" accept="text/plain" maxlength="6" class="entryFormInputBoxColor" size="40"></td>
        </tr>
        <tr>
         <td>Short description:</td>
         <td colspan="2"><textarea id="inShortDesc" name="inShortDesc" class="entryFormInputBoxColor" cols="31"></textarea></td>
        </tr>     
        <tr>
         <td>Chairman:</td>
         <td colspan="2"><input id="inChairman" name="inChairman" accept="text/plain" maxlength="80" class="entryFormInputBoxColor" size="40"></td>
        </tr>
        <tr>
         <td align="center"><input id="btnMenu" name="btnMenu" type="button" value="Return to Menu"></td>
         <td align="center"><input id="btnClear" name="btnClear" type="button" value="Clear Entries"></td>
         <td align="center"><input id="btnUpdate" name="btnUpdate" type="submit" value="Update Record"></td>
        </tr>
       </table>
      </form>
     </div> <!-- End of Entry Form Section -->

     <br>

     <div id="sectionGrid"> <!-- Begin of Grid Section -->
      <table id="tblGrid">
       <tr>
        <?php
         echo "---"; 
         require("../Lib/displaygrid.php");
         displaygrid::SetGridWithValues("ecid As ID, ecname As Category","electioncategorymaster");
         ?>
       </tr>
      </table>
     </div> <!-- End of Grid Section -->
    </body>
</html>
+2  A: 
  1. What is the extension of the file you're talking about? Does it have .php extension?
  2. If it has .php extension, make sure it resides on a web-server (somewhere in /httpdocs, /www of similar folder)
  3. If file extension is .html, then you should rename it to .php or add AddHandler x-httpd-php html definition to httpd.conf or .htaccess file.
  4. How do you open this file? You cannot just open it with the default application that OS suggests. It should be opened from the browser: http://localhost/site/file.php
  5. Make sure apache have mod_php installed. Check whether there is string containing 'LoadModule php5_module' in httpd.conf
  6. You could also insert code to the beginning of the file to be sure you get all errors:

    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    
altern
Good overview and checklist! +1
Boldewyn
@altern: Oh yeah... the extension is .html. So how to make a call to another .php file from within the second DIV?
RPK
@RPK: see edited answer
altern
@RPK: please resolve an answer is it helped finding solution
altern