web directoryearn money in seconds   Free file hosting, free video sharing

<<< The Web Hosting >>>


Go Back   Noeman GSM > Webhosting & Website development > Website development > Programming

Notices

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-30-2007, 11:17 AM
Spiral's Avatar
CO-Admin
 
Join Date: Sep 2004
Location: Martil
Age: 25
Posts: 15,331
Reputation: 17037
Spiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super Member
Default Create Simple ShoutBox

Create Simple ShoutBox

Create Simple 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 :
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>
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');  
//Kết nối DB  
$c=mysql_connect("localhost","$dbuser","$dbpass");  
//Lựa chọn DB  
mysql_select_db($dbname);  
//Lựa chọn tên DB  
$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"];  
//là nơi hiển thị trên trang web  
?>  
»<b><? echo "$place[name]"?></b><? echo ": $comments<br>" ?>  
<?  
}?>
You're done.Good luck
Reply With Quote
Sponsored Links
Reply

Bookmarks

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:06 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 2004-2008 Noeman . All rights reserved
Pay Day Loans | Best Credit Cards | Bad Credit Mortgages | Car Insurance | Mortgage Calculator

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110