Forum Moderators: coopster
The main URL is just a plain old HTML document that creates two horizontal frames.
<snip>
<html>
<frameset rows="75%,25%"><frame src="famtreebb.php">
<frame src="bbbot.htm">
</frameset>
</html>
The top frame is a simple PHP file. I used PHP so I could implode the message board posts that are stored in an HTML file. I am also using a table to "squeeze" the whole thing down. Here is the code:
<html><body>
<table align="center" width="75%" cellpadding="5" cellspacing="0" border="0">
<tr>
<th><h1><u>Rausch/Utlak Family Tree Bulletin Board<u></h1></th>
</tr>
</table>
<table align="center" width="75%" cellpadding="5" cellspacing="0" border="0">
<tr>
<tr>
<td>
<?
echo implode("",file("famtreebbmessages.htm"));
?>
</td>
</tr>
</table>
</body>
</html>
The bottom frame is an HTML file with basic forms. The button calls a simple PHP script that I put together with some code fragments I picked up and a little bit I came up with on my own.
The script simply takes the person's name and their message and writes them to the famtreebbmessages.htm file as an addition to an unordered list <ul>. When the top frame loads, the PHP script implodes this file and shows the current posts that have been written to this file by the bottom script.
Here is the script:
<html>
<body><?
$email = "jason@example.com";
$name = $_POST['name'];
$message = $_POST['message'];
//Send alert email
mail($email, "New Family Tree Message Posting", "You have a new posting to the Rausch/Utlak Message board!");
//Post message to board
$myFile = "famtreebbmessages.htm";
$fh = fopen($myFile, 'a+') or die("can't open file");
fwrite($fh, "<li><strong><font color='blue'>$name: </font></strong>$message</li>\r\n");
fclose($fh);
header("Location: http://www.example.com/bbbot.htm");
?>
</body>
</html>
You'll notice that the last line of the script just reloads the bottom frame so I get a clean form for the next post.
My problem is, I am looking for a way to refresh the top frame with the PHP script so the new posting shows in the top frame. I can post a test message and and then refresh the page and see what I just posted, but I am looking for a way to automate that.
I really could use some help with this last bit.
Thanks!
Jason.
[edited by: eelixduppy at 3:49 am (utc) on Mar. 3, 2009]
[edit reason] no URLs, please [/edit]
//naming the frames
<html>
<frameset rows="75%,25%"><frame src="famtreebb.php" name="famtree">
<frame src="bbbot.htm" name="bb"></frameset>
</html>
<inside bbbot.html>
<body onLoad="top.frames['famtree'].location.reload();">