Okay, here i'm back again with my website (
http://www.exca.be)
I have a problem with the shoutbox.
It stores all the data into the SQL itself. When you put in a message, it's all in CAPITALL LETTERS. I don't know why, but I have to rewrite all messages in myphpadmin to normal, because that's so ugly.
Secondly; I would like the names to appear in blue color (I guess that has to be done in the red sentence in the code below).
Third problem: in the statusbar you can see that the when on the page of the shoutbox the website is loading, and loading, and loading... and keeps on loading (it bothers me)
Please help, this can't be much for someone who knows it.
To be complete:
Below are the codes used on for the shoutbox if you would need them:
ACTIONSCRIPT GENERAL:
code:
instname.onSetFocus= function() { if (instname.text=="Name") { instname.text=""; } };
instmessage.onSetFocus= function() { if (instmessage.text=="Message") { instmessage.text=""; } };
content.text = "Loading Shouts...";
myData = new LoadVars();
myData.onLoad = Fillvalues;
myData.load("http://www.exca.be/website/shout.php");
function Fillvalues() {
content.text = eval("myData.content");
error = eval("myData.error");
}
ACTIONSCRIPT ON THE SHOUT BUTTON
code:
on (release) {
if (name eq "Name" || name eq "" || shout eq "Message" || shout eq "") {
error = "REQUIRED FIELDS MISSING";
} else {
myData.name = name;
myData.shout = shout;
myData.sendAndLoad("http://www.exca.be/website/shout.php", myData, "POST");
error = "SENDING DATA";
myData.onLoad = Check;
}
function Check() {
myData.load("http://www.exca.be/website/shout.php");
myData.onLoad = Fillvalues;
}
}
SHOUT.PHP
code:
<?
// BEKIJK README VOOR DETAILS
require("config.php");
if (!empty($_POST['name']) && !empty($_POST['shout'])) {
$name=strtoupper($_POST['name']);
$shout=strtoupper($_POST['shout']);
$now=time();
$sql=mysql_query("INSERT INTO shoutbox (id,date,name,shout) VALUES ('','$now','$name','$shout')")
or die("&error=ERROR: ERROR INSERTING&content=SEE ERROR DETAILS");
echo"&error=RECEIVED YOUR SHOUT";
}
else {
$sql=mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 50")
or die("&error=ERROR: WRONG QUERY&content=SEE ERROR DETAILS");
if(mysql_numrows($sql)==0) {
echo"&error=ERROR: RETURNED EMPTY&content=SEE ERROR DETAILS";
}
else {
while($row=mysql_fetch_array($sql)) {
$content="$content"."$row[name]:\n$row[shout]\n\n";
}
echo"&content=$content";
}
}
?>
CONFIG.PHP
code:
<?
$host="localhost";
$user="exca_be";
$pass="***************";
$db="exca_be";
mysql_connect($host,$user,$pass) or die("&error=ERROR: CAN'T CONNECT&content=SEE ERROR DETAILS");
mysql_select_db($db) or die("&error=ERROR: CAN'T SELECT DB&content=SEE ERROR DETAILS");
?>
Thanks in advance