Her

Home Web Programming PHP Basic Shoutbox

Basic Shoutbox

Author: Invano.com Author's URL: www.invano.com More by this author

Basic ShoutboxThis tutorial is very similar to the news portal and a basic shoutbox.

Alright, in this case, let's do the php code first. It should like something like below. You are more than welcome to change anything you want as long as you know what you are doing.

<?php
$tag
= ("<font size="2" face="Arial">

<a href="$website">$name: $message
</font>"
);

$file = fopen("tag.php", "r");
$read = fread($file, filesize("tag.php"));
fclose($file);
$invano = fopen("tag.php", "w"); //Leave alone look and learn, only edit if you know
php
$tag
=stripslashes($tag);
fwrite($invano, "$news $read");
fclose ($invano);
print
"<meta http-equiv="refresh" content="0;tag.php">"; //edit path to where the tag.php file falls
?>

Save this file as addtag.php

Now make a new file where it will store all the tags. Name it tags.php and CHMOD to 777.

Okay, we will do the form now and include the tag.php. Make 3 fields like below:

Name:
Website:
Message:

It should looks something like below:

<iframe name="tag" src="/img_articles/9674/tags.php" marginwidth="1" marginheight="0" height="200" width="200" border="0" frameborder="0"></iframe>
<FORM action="addtag.php" method="POST" targer="tag">
Name:<br>
<INPUT TYPE="TEXT" name="name" size="20"><br>
Website:<br>
<INPUT TYPE="text" name="website" size="20" value="http://"><br>
Message:<br>
<TEXTAREA NAME="message" COLS=16 ROWS=2></TEXTAREA><br>
<br>
<INPUT TYPE="Submit" name="submit" value="Tag it!" size="20">
</FORM>

Call this file tag.php. Note that, we have added the iframe to show all the tags.

Now add the following code anywhere in your site to show the tag board <? include "tag.php";?>