Post by damien1263 on May 18, 2007 2:25:04 GMT
Using this structure of my chat, I need to find out how I might go about doing it, also, when I log in, I need the logged in name as the name that will be displayed. I know basic PHP so here is my chat script.
I just need to know how to make a log in form with this.
and here is an example of the chat here.
damien1263.freehostia.com/MainChat.php
<html><head>
<script type='text/javascript' src='timescript.js'></script>
<meta http-equiv="refresh"content="15">
<link rel="stylesheet" type="text/css" href="style.CSS" />
</head><body>
<?
mysql_connect("local host","username","Password");
mysql_select_db("db_name");
$message = strip_tags($message);
if($submit)
{
$time=date("U");
$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 asc limit 60");
while($r=mysql_fetch_array($result))
{
$time=$r["time"];
$id=$r["id"];
$message=$r["message"];
$name=$r["name"];
//Smilies////
$message = str_replace(":)","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/smiley.gif\" alt=\"Smile\">",$message);
$message = str_replace(":D","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/grin.gif\" alt=\"grin\">",$message);
$message = str_replace(":(","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/sad.gif\" alt=\"sad\">",$message);
$message = str_replace(":'(","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/cry.gif\" alt=\"cry\">",$message);
$message = str_replace(":p","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/tongue-1.gif\" alt=\"Raspberry\">",$message);
$message = str_replace(":P","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/tongue-1.gif\" alt=\"Raspberry\">",$message);
$message = str_replace(">:|","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/angry.gif\" alt=\"angry\">",$message);
$message = str_replace("o.O","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/shocked.gif\" alt=\"Whoa\">",$message);
$message = str_replace(";)","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/blueWink.gif\" alt=\"wink\">",$message);
$message = str_replace("8-)","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/cool.gif\" alt=\"cool\">",$message);
$message = str_replace(":roll","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/rolleyes.gif\" alt=\"rolleyes\">",$message);
$message = str_replace(":X","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/lipsrsealed.gif\" alt=\"lips sealed\">",$message);
$message = str_replace(":*","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/kiss.gif\" alt=\"Kiss\">",$message);
$message = str_replace("XD","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/zena.jpg\" title=\"XD\">",$message);
$message = str_replace(":'/","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/ummmm.gif\" alt=\"Laugh\">",$message);
$message = str_replace(":vomit","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/puke.gif\"alt=\"puke\">",$message);
$message = str_replace("BRB","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/BRB.gif\"alt=\"puke\">",$message);
$message = str_replace("brb","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/BRB.gif\"alt=\"puke\">",$message);
$message = str_replace(":lol","<img src=\"http://smilies.vidahost.com/otn/laughing/astrosmiley2.gif\"alt=\LOL\">",$message);
$message = str_replace(":LOL","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/astrosmiley2.gif\"alt=\LOL\">",$message);
$message = str_replace(":shake","<img src=\"http://i54.photobucket.com/albums/g93/damien1263/SNEMOTICON13.gif\"alt=\shame\">",$message);
///UBBC Code
$message = preg_replace ("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "<font color=\"\\1\">\\2</font>",$message);
$name = preg_replace ("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "<font color=\"\\1\">\\2</font>",$name);
$message = preg_replace("/\[url\](.+)\[\/url\]/iSU", "<a href='$1' target='_blank'>$1</a>", $message);
$name = preg_replace("/\[url\](.+)\[\/url\]/iSU", "<a href='$1' target='_blank'>$1</a>", $name);
$message = preg_replace("/\[b\](.+?)\[\/b\]/is",'<strong>\1</strong>', $message);
$name = preg_replace("/\[b\](.+?)\[\/b\]/is",'<strong>\1</strong>', $name);
$message = preg_replace("#\[i\](.*?)\[/i\]#si","<i>\\1</i>", $message);
$name = preg_replace("#\[i\](.*?)\[/i\]#si","<i>\\1</i>", $name);
$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);
$message = preg_replace("/\/me (.*)/i", "<em>*$1*</em>", $message);
?>
| <font color="white"size="2"><? echo"<script type='text/javascript'>printCurrentTime(" . $time . ");</script>"; ?> |</font><font size="6"color="808080"face="Dark11"><? echo $name ?>:</font>
<font size="5"color="white"face="arial"><? echo $message ?></font><br><br>
<?}?>
<script type="text/javascript">
window.setTimeout('window.scrollBy(0,5000)', 100);
-->
</script>
</body></html>
I just need to know how to make a log in form with this.
and here is an example of the chat here.
damien1263.freehostia.com/MainChat.php