Go Back   Data Center, Colocation, Cloud Computing, Storage, Dedicated Servers Forums > General DataCenter Discussion Forum > Discuss about Datacenter Software/Hardware Related Issues.

Reply

 

Thread Tools
  #1  
Old 03-11-2011, 02:12 AM
mike2011 mike2011 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 103
Default Shoutbox-PHP :Easy of installation

Installing shoutboxphp is very simple. I thought of sharing the procedure:

//Here we are making the shoutbox color fields, and tables.

shoutbox.php
Make sure you have the database called "config.php"
<?php include("sfield.php"); ?>
<?php include("config.php"); ?>
<?php //This part is where it shows "Admin CP" and "View Full Shoutbox"
?>
<span class="style1">
<a href="/administratorcp">Admin CP</a> | </span> <a href="viewfullsbox.php">View Full Shoutbox
</a>
| <a href="index.php">Refresh
</a>
</form></td>
</tr>
<tr>
<td height="32" valign="top"><p class="style3"><?php
$result = mysql_query("SELECT * FROM shoutbox order by id DESC LIMIT 5")
or die(mysql_error());
echo "<table border='0'>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['username']; echo ": "; echo $row['message'];
echo "</tr><td>";

echo "</hr></tr>";
}

echo "</table>";
?>

&nbsp;</p></td>
</tr>
</table>




sfield.php
//All that does is displays the shoutbox but we need it to add the shouts and display the fields.
<?php require_once("config.php"); ?>
<style type="text/css">
<!--
.style3 {color: #000000}
body,td,th {
color: #000000;
}
-->
</style>

<table width="838" border="1" cellpadding="0" bgcolor="#EAF9E3" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="834" height="32" valign="top"><form name="form1" method="post" action="addshout.php">
<label>
<input name="username" width="335" type="text" id="username" value="Username">
</label>
<label>
<input name="message" width="335" type="text" id="message" value="Message">
</label>
<label>
<input type="submit" name="submit" width="500" id="submit" value="Shout">
</label>



addshout.php

//Now here is what adds the shout:
<script type="text/javascript">
<!--
function delayer(){
window.location = "index.php"
}
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 0)">
<?php require_once("shoutbox.php"); ?>
<?php require_once("config.php"); ?>
<?php
$username = $_POST['username'];
$message = $_POST['message'];

mysql_query("INSERT INTO shoutbox(username, message) VALUES('$username', '$message')")
or die(mysql_error()); ?>
<html>

Go into PHPMYADMIN n and create table called: shoutbox
Then make the fields:

id
username
message
Reply With Quote
Reply


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 Off

Forum Jump


All times are GMT. The time now is 08:54 AM.

Member Area



Data Center Industry Daily News


Cloud and Dedicated Hosting


Sponsors Managed Servers Sponsored by DedicatedNOW.
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.