1

My php code is inside html and when I open my html file the file does not run as code.So i used inspect element of my chrome browser and it shows all my php code as comment.how ca i uncomment this because in my code it is already uncommented. My code:

 <form  id="data" class="form-geofence" role="form" method="post" action="geofencedata.php">
                <h2 class="form-geofence-heading">Update Geofence</h2>
        <?php include_once'./import.php';?>
        <?php
                include_once'./connectionusers.php';
                /*** query the database ***/
                $sql=pg_query("SELECT name FROM geofence");
                echo "<select name='category_id'>";
                while($row = pg_fetch_array($sql))
                {
                    /*** create the options ***/
                                echo "<option value=''>";
                                echo $row['name'];
                                echo "</option>";
                }
                echo "</select>";
                }
                catch(PDOException $e)
                {
                    echo 'No Results';
                }
            ?>
Su_race
  • 47
  • 1
  • 10

1 Answers1

0

Make sure your file has the extension .php, and the page is run on a server.

dan
  • 67
  • 1
  • 1
  • 9