Home arrow PHP arrow Page 8 - Building a Quick and Easy Tag Board

doBoard() Function - PHP

Tag boards enable users to leave a short message on your site without having to go through the trouble of registering. From a development point of view, they are actually rather simple to develop. In this article we will create a quick and easy tag board for any web site. We will be taking advantage of the php and MySQL technologies.

  1. Building a Quick and Easy Tag Board
  2. Did Anyone Say MySQL?
  3. Our Tag Board Script
  4. What Makes Our Tag Board Tick?
  5. Our Tag Board Functions!
  6. Retrieval and Sorting of Tags
  7. Results
  8. doBoard() Function
  9. doInsert() Function
  10. Ensuring Data Submitted Does Not Fail
  11. Inserting into the Tag Board
By: Haiden Taylor
Rating: starstarstarstarstar / 120
November 03, 2004

print this article



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()
<title>DevShift.com Tag Board</title>
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
<form action="board.php?do=Insert" target="tag_box" method="POST">
<table width="150" height="250" bgcolor="#FFFFFF" style="border: 1px solid #000000">
<td height="150"><IFRAME name="tag_box" height="150" width="150" src="board.php?do=Tags" frameborder="0"></IFRAME></td>
<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>

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.

>>> More PHP Articles          >>> More By Haiden Taylor

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: