IT Community - Software Programming, Web Development and Technical Support

Create Simple ShoutBox

This is a discussion on Create Simple ShoutBox within the PHP Programming forums, part of the Web Development category; Hello peepz,this is simple tutorials to create shoutbox. Step 1 : Create database with information : PHP Code: CREATE TABLE&...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 03-08-2007, 10:03 PM
spid4r spid4r is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 55
spid4r is on a distinguished road
Default Create Simple ShoutBox

Hello peepz,this is simple tutorials to create shoutbox.

Step 1 : Create database with information :
PHP Code:
CREATE TABLE `tagboard` ( 
`
idint(7NOT NULL auto_increment
`
namevarchar(250NOT NULL default ''
`
commentstext NOT NULL
`
datetimestamp(14NOT NULL
PRIMARY KEY (`id`), 
TYPE=MyISAM AUTO_INCREMENT=419 
Step 2 : Create file config.php with content
PHP Code:
<? 
$dbuser
=""//Database Username 
$dbname=""//Database Name 
$dbpass=""// Database Password 
?>
Step 3: Create File tag.php with content :
PHP Code:
<iframe src="view.php" name="tag" width="179" height="130" frameborder=0 marginwidth="0" marginheight="0"></iframe><form method="POST" ACTION="todo.php"
<
input type="text" NAME="name" Value=">"
<
textarea NAME="post" cols="27" rows="3"></textarea
<
br
<
input TYPE="submit" value="Submit"
Step 4: Create file todo.php with content :
PHP Code:
<?php 
if ($name == '' || $post == ''") 

die ("
Please fill all fieldsClick <a HREF=tag.php>here</ato return."); 

include('config.php'); 
$post = preg_replace("
/</","&lt;",$post); 
$post = preg_replace("
/>/","&gt;",$post); 
$post = nl2br($post); 
$comments = "
$post"; 

$c=mysql_connect("
localhost","$dbuser","$dbpass"); 
mysql_select_db($dbname); 
$todo="
INSERT INTO tagboard (id,name,comments,dateVALUES('','$name','$comments',now())"; 
$solution = mysql_query($todo) or die (mysql_error()); 
if ($solution) 

?> 
<meta http-equiv="
refresh" content="0;url=tag.php" > 
<? 
} ?>
Step 5 : Finally,create file view.php with content :
PHP Code:
<?php 
include('config.php'); 
$c=mysql_connect("localhost","$dbuser","$dbpass"); 
mysql_select_db($dbname); 
$todo='SELECT * FROM `tagboard` order by id desc LIMIT 50'
$solution=mysql_query($todo); 
while (
$place mysql_fetch_array($solution)) 

$id=$place["id"]; 
$comments=$place["comments"]; 
?> 
»<b><? echo "$place[name]"?></b><? echo ": $comments<br>" ?> 
<? 
}?>
You're done.
Good luck:


Full tutorial you can view here :
Create Simple ShoutBox - PHP TUTORIALS
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple program help... hkp819 C and C++ Programming 1 12-28-2008 07:38 AM
Simple URL Variable jennifergttfrd PHP Programming 0 12-27-2008 07:45 AM
Simple question for PHP thomasEpand PHP Programming 0 11-18-2008 10:42 PM
How to create a simple dll using VC++ and how to register it windows XP? oxygen C and C++ Programming 1 07-24-2007 04:25 AM
simple example for the java concepts lavanya Java Programming 2 07-20-2007 05:48 AM


All times are GMT -7. The time now is 10:51 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0