Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Services > Web Designing and Development

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-01-2007, 05:30 AM
Banned
 
Join Date: Apr 2007
Location: Bharatpur-10,Chitwan
Posts: 25
Send a message via Yahoo to anish
Default shoutout box

Well, first we will start with the shoutbox, after you have all of the codes up, we will break it up and show you how to customize it
Shoutbox:

Code:

Error: Please enter your nickname.";
}
else if ($message == "") {
echo "Error: No message to be sent.";
}
else if ($mlen > $maxlength) {
echo "Error: Message too long.";
}
else {
$db = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname) or die(mysql_error());
mysql_query("INSERT INTO shoutbox(name,message,date,ip) VALUES('$name','$message','$date','$ip')");
}
}
$db = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT * FROM shoutbox ORDER BY id DESC LIMIT 20";
$result = mysql_query($query);
echo "
\n"; echo "
    \n"; while($r = mysql_fetch_array($result)) { $name = $r['name']; $name = strip_tags($name); $message = $r['message']; $message = strip_tags($message); echo "
  • >$name: $message
  • \n"; } echo "
\n"; echo "
\n"; mysql_close($db); ?>
Nickname:
<
Message:

?>
Save this as shoutbox.php
Configuration:
Code:
Save this as config.php
SQL query
Code:
CREATE TABLE shoutbox (
id INT(10) not null AUTO_INCREMENT,
name VARCHAR(20),
message TEXT,
date VARCHAR(15),
ip VARCHAR(15),
PRIMARY KEY(id)
);
Save all of these in a folder called, sb

Oh, I almost forgot,
put
Code:
where you want your shoutbox to be.

Customize

Now if you look at the begining of you shoutbox.php code, you will see this

Code:
Change that to change the look of your shoutbox
-----------------------------------------------------------------
-Anish
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:53 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum