# My tagboard script

**URL:** <https://forum.kirupa.com/t/my-tagboard-script/23778>\
**Category:** programming\
**Created:** [June 22, 2003, 6:00am UTC](https://forum.kirupa.com/t/my-tagboard-script/23778 "2003-06-22T06:00:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delsaber](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@Delsaber](https://forum.kirupa.com/u/Delsaber)\
**Post date:** [June 22, 2003, 6:00am UTC](https://forum.kirupa.com/t/my-tagboard-script/23778/1 "2003-06-22T06:00:56Z")

</div>

```php

<?php 
if ($mode == "") {
?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;&nbsp;</td>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table bgcolor="#000000" border="0" cellspacing="1" cellpadding="0">
<tr>
<td bgcolor="#333333">
<iframe name="tagwin" src="tag.phtml?mode=board" style="width:152px;height:150px" frameborder="0"></iframe>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<form action="tag.phtml?mode=board" method="post" target="tagwin">
<input type="hidden" name="submitted" value="true">
<input type="text" name="name" style="background-color:#333333;border:1px solid #000000;width:150px;font-family:verdana;font-size:8pt;color:#c0c0c0;" />
</td>
</tr>
<tr>
<td>
<textarea name="message" cols="17" rows="3" size="100" style="background-color:#333333;border:1px solid #000000;width:150px;height:50px;font-family:verdana;font-size:8pt;color:#c0c0c0;"></textarea>
</td>
</tr>
<tr>
<td>
<input type="submit" value="Tag!" style="background-color:#333333;border:1px solid #000000;width:100px;font-family:verdana;font-size:8pt;color:#c0c0c0;">
<a href="tag.phtml?mode=board" target="tagwin">refresh</a>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
if ($mode == "board") {
$fp = fopen('tag.txt', 'a+');

$contents = fgets($fp);
echo $contents;
if ($submitted == "true") {
$newtag = "&lt; $name &gt; $message <br>"; 
fputs($fp, $newtag);
fclose($fp);

$newtag = "";
$submitted = "false";
}
}
?>

```

That is my code. It is sloppy but oh well. I have to write to a test file becase do not have MySql access. It works just fine. Just wondering how to make the code more efficient… Just learning php and I want to know if that is good for a first program… I also made the text hit counter…

Go to [http://www2.gmscripts.com/users/davidv0/index.phtml](http://www2.gmscripts.com/users/davidv0/index.phtml) and click on the tagboard button to test it…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 22, 2003, 6:04am UTC](https://forum.kirupa.com/t/my-tagboard-script/23778/2 "2003-06-22T06:04:24Z")

</div>

if your script works then its good enough.

When dealing with scripts this small, efficiency doesn’t really matter because there isn’t much to run. your code is fine. 🙂
