What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Who knows something about SQL and PHP

Who knows something about SQL and PHP
Author: Message:
Exca
Senior Member
****

Avatar
Not illiteral, just ignoring you

Posts: 509
Reputation: 12
36 / Male / –
Joined: Mar 2004
Status: Away
O.P. Who knows something about SQL and PHP
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 :)

This post was edited on 01-05-2008 at 04:41 PM by Exca.
But that is my opinion!

[Image: djexcaround.gif]
01-05-2008 04:31 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Who knows something about SQL and PHP - by Exca on 01-05-2008 at 04:31 PM
RE: Who knows something about SQL and PHP - by NanaFreak on 01-05-2008 at 04:40 PM
RE: Who knows something about SQL and PHP - by Exca on 01-05-2008 at 04:42 PM
RE: Who knows something about SQL and PHP - by NanaFreak on 01-05-2008 at 04:43 PM
RE: Who knows something about SQL and PHP - by Exca on 01-05-2008 at 04:45 PM
RE: Who knows something about SQL and PHP - by NanaFreak on 01-05-2008 at 04:48 PM
RE: Who knows something about SQL and PHP - by Exca on 01-05-2008 at 04:53 PM
RE: Who knows something about SQL and PHP - by Exca on 01-05-2008 at 04:57 PM
RE: Who knows something about SQL and PHP - by NanaFreak on 01-05-2008 at 05:00 PM
RE: Who knows something about SQL and PHP - by Exca on 01-05-2008 at 05:04 PM
RE: Who knows something about SQL and PHP - by surfichris on 01-05-2008 at 10:07 PM
RE: Who knows something about SQL and PHP - by Exca on 01-05-2008 at 10:33 PM
RE: Who knows something about SQL and PHP - by Tochjo on 01-05-2008 at 10:35 PM
RE: Who knows something about SQL and PHP - by Exca on 01-05-2008 at 10:42 PM
RE: Who knows something about SQL and PHP - by surfichris on 01-06-2008 at 11:35 AM
RE: Who knows something about SQL and PHP - by Exca on 01-06-2008 at 12:43 PM
RE: Who knows something about SQL and PHP - by Volv on 01-09-2008 at 11:36 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On