Hi Shem
You can see the "almost" finsihed hack of what i did here:
You will need to register though

You had the form on the main page with an iframe below it that called shoutbox.asp.
All i did was move the table/form into shoutbox.asp and still set shoutbox.asp as the source for the iframe in default.asp.
Then when submitting the form in shoutbox.asp, i posted back to itself catching the form contents using QueryString and added it to the database.
Also in shoutbox.asp is another iframe which loads addshout.asp (now the wrong name for it). That page just gets all shout messages from the db and displays them. i put a meta refresh inside addshout.asp to it can refresh while you are typing a new message up in shoutbox.asp.
See below

. I did add one of two style changes to the dark default stylesheet because i couldnt figure out which styles i needed lol. I havent done any web development ages, so i'm a bit rusty. I would really like to add a smily selector to the shoutbox as well :)
I changed the code block in default.asp to be:
<!-- SHOUTBOX -->
<% If lngLoggedInUserID <> 2 Then%>
<table cellspacing="0" cellpadding="0" align="center" width="98%" border="0" height="200px">
<tr bgcolor="black" valign="top">
<td bgcolor="black" height="200px" valign="top"><iFrame ID="IFrame1" src="shoutBox.asp" style="width:100%;" height="100%" scrolling="no" frameborder="0"></iFrame></td>
</tr>
</table>
<%end if%><!-- SHOUTBOX END -->
|
I then modified shoutBox.asp to the following:
[code]
<% @ Language=VBScript %>
<%
Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<%
Dim strShoutText
Dim sqlAddShout
if Request.QueryString("action") <> "" then
' we need to add to the database
strShoutText = Request.Form(
"txtShout")
strShoutText = removeHTML(strShoutText,300,
True)
sqlAddShout=
"INSERT INTO tblShouts (Author_Name, Shout_Msg)"
sqlAddShout=sqlAddShout &
" VALUES "
sqlAddShout=sqlAddShout &
"('" & strLoggedInUsername & "',"
sqlAddShout=sqlAddShout &
"'" & strShoutText & "')"
adoCon.Execute sqlAddShout
end if
%>
<
html>
<
head>
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
</
head>
<
body bgcolor="#373737">
<
script language