// Includes the class file to select a row of data from the database.


// The primary key of the row to be selected is passed through URL and hence pulled through $_GET array.

$select=new selectClass();

// Creates new object of selectClass.


// Passes the primary key, $id as an argument to the function selectFunction of class selectClass. 


// $name is pulled from the associative array $select


<!DOCTYPE html>



<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">

<!-- The above line links to the external stylesheet of w3.css -->

<title>A form for PHP OOP</title>



<div class="w3-container w3-blue w3-large">

<form name="form" method="post" action="editaction.php">

<!-- Data submitted to this form will be processed by editaction.php -->


<p><input type="text" name="name" value="<?php echo $name;?>" /></p>

<!-- The form is pre populated by its current value -->

<p><input type="hidden" name="id" value="<?php echo $id;?>"/></p>

<!-- We need to pass the primary key, $id to editaction.php in hidden form -->

<p><input type="submit" name="submit" />

<input type="reset" name="reset" /></p>