Im using a proboards.com site, and I have a variable that sees the name of the current person posting and whatnot, http://drew112.proboards85.com/index.cgi if you go there you can see it at the very top, I got the name to display, using JS, the Iframe is a php with this code:
<?
mysql_connect("mysql1.100ws.com","username","*****");
mysql_select_db("database");
$message = strip_tags($message);
if($submit)
{
$time=date("F j, Y, g:i a");
$result=MYSQL_QUERY("INSERT INTO shoutbox (id,name,message,time)".
"VALUES ('NULL','$name', '$message','$time')");
}
?>
<?php
$result = mysql_query("select * from shoutbox order by id desc limit 20");
while($r=mysql_fetch_array($result))
{
$time=$r["time"];
$id=$r["id"];
$message=$r["message"];
$name=$r["name"];
$message = str_replace(":)","<img src=\"http://s3.images.proboards.com/smiley.gif\" alt=\"Smile\">",$message);
$message = str_replace(":D","<img src=\"http://s3.images.proboards.com/grin.gif\" alt=\"grin\">",$message);
$message = str_replace(":(","<img src=\"http://s3.images.proboards.com/embarassed.gif\" alt=\"sad\">",$message);
$message = str_replace(":'(","<img src=\"http://s3.images.proboards.com/cry.gif\" alt=\"cry\">",$message);
$message = str_replace(":p","<img src=\"http://s3.images.proboards.com/tongue.gif\" alt=\"Raspberry\">",$message);
$message = str_replace(">:|","<img src=\"http://s3.images.proboards.com/angry.gif\" alt=\"angry\">",$message);
$message = str_replace("o.O","<img src=\"http://s3.images.proboards.com/shocked.gif\" alt=\"Whoa\">",$message);
$message = str_replace(";)","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/wink.gif\" alt=\"wink\">",$message);
$message = str_replace("8-)","<img src=\"http://s3.images.proboards.com/cool.gif\" alt=\"cool\">",$message);
$message = str_replace(":roll","<img src=\"http://s3.images.proboards.com/rolleyes.gif\" alt=\"rolleyes\">",$message);
$message = str_replace(":X","<img src=\"http://s3.images.proboards.com/lipsrsealed.gif\" alt=\"lips sealed\">",$message);
$message = str_replace(":*","<img src=\"http://s3.images.proboards.com/kiss.gif\" alt=\"Kiss\">",$message);
$message = str_replace(":LOL","<img src=\"http://s3.images.proboards.com/laugh.gif\" alt=\"Laugh\">",$message);
$message = str_replace(":bird","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/boid.gif\" alt=\"Birdie\">",$message);
$message = preg_replace ("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "<font color=\"\\1\">\\2</font>",$message);
$message = preg_replace("/\[url\](.+)\[\/url\]/iSU", "<a href='$1' target='_blank'>$1</a>", $message);
$message = preg_replace("/\[b\](.+?)\[\/b\]/is",'<strong>\1</strong>', $message);
$message = preg_replace("#\[i\](.*?)\[/i\]#si","<i>\\1</i>", $message);
$message = str_replace ("[move]", "<div align=\"center\"><marquee width=\"90%\">", $message);
$message = str_replace ("[/move]", "</marquee></div>", $message);
$message = preg_replace("/\[img\](.*?)\[\/img\]/si","<img src=\"\\1\" border=\"0\">",$message);
?>
<b><font color="#90b0FF"><? echo $name ?>:</font></b>
<font size="2"><? echo $message ?></font><br><br>
<?}?>
<meta http-equiv="refresh"content="6">
I need to find a way to check if say
if($colorName="admin")
{
$colorName="#FF0000";
something like that, but use the $name parser.
Also, is there a way to after the message is entered it goes to the bottom? Right now it stays at the top. I would like it to go to the bottom.