I am very new at OOP, and i want to get things right at the first learning cycle.
I have a HTML form:
<?php
include("classes/Gaestebog.php");
$gaestebog = new Gaestebog();
?>
<html>
<head>
</head>
<body>
<form action="" method="post">
<table>
<tr>
<td>Navn:</td>
<td><input type="text" name="navn" value="Patrick" /></td>
</tr>
<tr>
<td>Besked:</td>
<td><input type="text" name="besked" value="Hej med dig !!" /></td>
</tr>
<tr>
<td><input type="submit" name="opret" value="Opret" /></td>
</tr>
</table>
</form>
</body>
</html>
and a Guestbook class:
<?php
class Gaestebog {
public function Gaestebog() {
}
public function getPosts() {
}
public function addPost() {
}
}
?>
I want the :Guestbook to invoke the addPost method on form submission. How would i approach this?