Building a Quick and Easy Tag Board - doBoard() Function (
Page 8 of 11 )
The next function in our script is doBoard() which contains the HTML to format our tag board. Everything is reasonably basic and since knowledge of HTML is assumed, we won't go into to much detail on this. The code used in the doBoard function can be found below:
function doBoard()
{
?>
<html>
<head>
<title>DevShift.com Tag Board</title>
<style>
body {
font-family: verdana,arial,helvetica,sans-serif; font-size: 11px; background-color: #FFFFFF;
}
td {
font-family: verdana,arial,helvetica,sans-serif; font-size: 11px; color: #666666;
}
.inputform {
BORDER-RIGHT: #efefef 1px solid; BORDER-TOP: #000000 1px solid; FONT: 11px Verdana; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #efefef 1px solid; BACKGROUND-COLOR: #efefef
}
.inputformsub {
BORDER-RIGHT: 1px outset; PADDING-RIGHT: 2px; BORDER-TOP: 1px outset; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; FONT: 11px Verdana; BORDER-LEFT: 1px outset; PADDING-TOP: 2px; BORDER-BOTTOM: 1px outset; BACKGROUND-COLOR: #dedede
}
</style>
</head>
<body>
<form action="board.php?do=Insert" target="tag_box" method="POST">
<table width="150" height="250" bgcolor="#FFFFFF" style="border: 1px solid #000000">
<tr>
<td height="150"><IFRAME name="tag_box" height="150" width="150" src="board.php?do=Tags" frameborder="0"></IFRAME></td>
</tr>
<tr>
<td height="100" align="center">Name:<br><input type="text" name="__name" size="20" maxlength="55" class="inputform"><br>URL:<br><input type="text" name="__url" size="20" maxlength="255" value="http://" class="inputform"><br>Your Entry:<br><input type="text" name="__entry" size="20" maxlength="400" class="inputform"><br><input type="submit" value="Submit Entry" class="inputformsub"></td>
</tr>
</table>
</form>
</body>
</html>
<?
}
The main area of interest in this is the Inline Frame (iframe) where we open a new instance of our script in the Inline Frame. See Below:
<IFRAME name="tag_box" height="150" width="150" src="board.php?do=Tags" frameborder="0"></IFRAME>
As you can see, we have named the frame “tag_box” and set the src (source) to board.php?do=Tags which is the function mentioned above. This as we know will display all the tags stored in our database.
Another area of this code we need to note is the form where users can submit their tags. More specifically we want to look at the following code:
<form action="board.php?do=Insert" target="tag_box" method="POST">
Which will tell the form to load the page “board.php?do=Tags” into our Inline Frame.