Monday, 2024-05-13, 12:48 PM
ဟက္ကာဖိုရမ္
Main Registration Login
Welcome, Guest · RSS
[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum » WEB DEVELOPMENT » PHP » ShoutBox with PHP and MySQL
ShoutBox with PHP and MySQL
ဟတ္ကာDate: Tuesday, 2010-10-12, 7:38 PM | Message # 1
Major
Group: Administrators
Messages: 91
Reputation: 0
Status: Offline
ဒီ Tutorials ေလးကေတာ့ PHP နဲ႔ MySQL ကို အသံုးျပဳၿပီး Shout Box ေလး တစ္ခုေရးၾကည့္မွာ ျဖစ္ပါတယ္။ လုပ္ငန္းလုပ္ပံုကို ပံုစံခ်ၾကည့္မယ္ဆိုရင္

* MySQL အေနနဲ႔ Shoutbox က အခ်က္အလက္ေတြကို သိမ္းမယ္။
* Embedded HTML နဲ႔ CSS ဖိုင္ကို သံုးၿပီး ၾကည့္လို႔ ေကာင္းသြားေအာင္ စီစဥ္မယ္။
* PHP ကေန MySQL ကို ခ်ိတ္ဆက္မယ္။ အဲဒီလို ခ်ိတ္ဆက္ၿပီး အခ်က္အလက္ေတြ သိမ္းမယ္၊ ျပန္ေခၚမယ္။
* Gravatar ကိုသံုးမယ္၊ IP Address ေတြကို မွတ္ထားတာေတြ ပါမယ္။

အဆင့္ (၁)

Database တည္ေဆာက္ျခင္း

Database တည္ေဆာက္ဖို႔အတြက္ ကိုယ့္မွာ XAMPP ရွိၿပီး (ဒါမွမဟုတ္) MySQL ရွိၿပီး ျဖစ္တယ္လို႔ ယူဆပါတယ္။ ဒါေၾကာင့္ ဒါေတြ ရွိၿပီးသားလို႔ ယူဆပါတယ္။

* Hostname (eg. localhost)
* Database name
* Username for database
* Password

Database File ထဲမွာ ပါ့မယ္ Field ေတြကေတာ့
NAME DATA TYPE SIGNED NULL AI INDEX
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY
name VARCHAR(45) NOT NULL
email VARCHAR(60) NOT NULL
post TEXT NOT NULL
ipaddress VARCHAR(45) NOT NULL

စတာေတြ ပါမွာ ျဖစ္ပါတယ္။ SQL အေနနဲ႔ တစ္ခါတည္း တန္းေဆာက္ခ်င္တယ္ ဆိုရင္

CREATE TABLE `shouts` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`email` VARCHAR(60) NOT NULL,
`post` TEXT NOT NULL,
`ipaddress` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`)
);

phpmyadmin

အဲဒီလို ထည့္မယ္ဆိုရင္ Go ကို ႏွိပ္လိုက္တဲ့အခါ

Successful

အဲဒီလို Your SQL query has been executed successfully ဆိုရင္ Database ေဆာက္လို႔ ၿပီးသြားပါၿပီ။ ဒီတစ္ခါ ေရွ႕ဆက္ရမယ့္ အပိုင္းကေတာ့

Files လိုအပ္ခ်က္မ်ား

File လိုအပ္ခ်က္အရေတာ့

* index.php
* style.css
* db.php

ဆိုၿပီး ဖိုင္ သံုးမ်ဳိး လိုပါမယ္။ Folder အေနနဲ႔ကေတာ့ images ဆိုတဲ့ folder တစ္ခုလိုမွာ ျဖစ္ပါတယ္။

Database သို႔ ခ်ိတ္ဆက္ျခင္း

php ကေန MySQL ကိုခ်ိတ္ဆက္တဲ့အခါ (Database ကို Script ကေန ခ်ိတ္ဆက္တဲ့အခါ) db.php သံုးမွာ ျဖစ္ပါတယ္။ အဓိက ထည့္ရမွာ ေတြကေတာ့ ခ်ိတ္ဆက္မယ့္ Server, Username, password နဲ႔ Database နာမည္ေတြပဲ ျဖစ္ပါတယ္။ ကဲ စေရးၾကည့္ရေအာင္

<?php
$host = 'localhost'; //usually localhost
$username = 'root'; //your username assigned to your database
$password = 'password'; //your password assigned to your user & database
$database = 'shoutbox'; //your database name
?>

အဆင့္ (၂)

index.php ကို တည္ေဆာက္ျခင္း

အေပၚမွာ Database ေတြ တည္ေဆာက္ၿပီးပါၿပီ။ အဲဒီအျပင္ Database နဲ႔ခ်ိတ္ဆက္တဲ့ db.php ဆိုတာကိုလည္း ေရးခဲ့ၿပီးၿပီ။ ခုဆက္ေရးမယ့္ အပိုင္းကေတာ့ တကယ္တန္း shoutbox ကိုေခၚလိုက္တဲ့အခါ အရင္းဆံုး Run ရမွာ ျဖစ္တဲ့ index.php ပါပဲ။

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Shoutbox</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="container">

<h1>Shoutbox</h1>
<h5>MyanmarTutorials</h5>

<div id="boxtop"></div>
<div id="content">

ဒါကေတာ့ ထိပ္ဆံုးမွာ ေရးေပးရမွာ ျဖစ္ပါတယ္။ HTML နဲ႔ အတူတူပါပဲ။ ခုမွ php က စမွာပါ။

Database သို႔ ခ်ိတ္ဆက္ျခင္း

Database ခ်ိတ္ဆက္တဲ့ Code ကို နဂိုမူလ ေရးထားတဲ့ ေနာက္မွာပဲ ဆက္ေရးရမွာ ျဖစ္ပါတယ္။ ေရးမယ့္ code ကေတာ့

<?php
$self = $_SERVER['PHP_SELF']; //the $self variable equals this file
$ipaddress = ("$_SERVER[REMOTE_ADDR]"); //the $ipaddress var equals users IP
include ('db.php'); // for db details

// defines a $connect variable, which when used
// will attempt to connect to the databse using
// details provided in config.php
// if it fails, will display error - or die();
$connect = mysql_connect($host,$username,$password) or die('<p class="error">Unable to connect to the database server at this time.</p>');

// connect to database using details provided
// and uses the $connect variable above
// if it fails, will return error - or die();
mysql_select_db($database,$connect) or die('<p class="error">Unable to connect to the database at this time.</p>');

အေပၚဆံုး Line ႏွစ္ေၾကာင္းကို ရွင္းျပရမယ္ဆိုရင္

* $self = $_SERVER['PHP_SELF']; ကေတာ့ file နာမည္ကို ျပန္ယူတာ ျဖစ္ပါတယ္။
* $ipaddress = (“$_SERVER[REMOTE_ADDR]“); ကေတာ့ အသံုးျပဳသူရဲ႕ IP Address ကို ယူတာ ျဖစ္ပါတယ္။

ႏွစ္ခုလံုးက PHP Built-in Function ေတြ ျဖစ္ပါတယ္။

ကၽြန္ေတာ္တို႔ အေနနဲ႔ Database ကို ခ်ိတ္ဆက္မွာ ျဖစ္တဲ့အတြက္ database ကို ခ်ိတ္ဆက္ဖို႔ရာ အခ်က္အလက္ေတြ ထည့္ထားတဲ့ db.php ဆိုတာကို ျပန္ေခၚေပးဖို႔ လိုပါတယ္။ ဒါေၾကာင့္ တတိယ တစ္ေၾကာင္းျဖစ္တဲ ့include(‘db.php’); ဆိုတာကို ေရးေပးဖို႔ လိုပါတယ္။

ေနာက္တစ္ေၾကာင္းကေတာ့ $connect ဆိုတဲ့ variable ပါ။ အဲဒီအထဲကို mysql_connect ဆိုတဲ့ function ကုိသံုးၿပီး database ကိုခ်ိတ္ဆက္ထားတဲ့ အခ်က္အလက္ေတြ ထည့္ေပးပါတယ္။ mysql_connect ဆိုတဲ့ Function ကို ေလ့လာခ်င္တယ္ ဆိုရင္ ဒီေနရာ မွာ ေလ့လာႏိုင္ပါတယ္။ အကယ္၍ ခ်ိတ္ဆက္ မရခဲ့ရင္ေတာ့ Unable to connect to the database server at this time ဆိုတဲ့ Error တက္လာမွာ ျဖစ္ပါတယ္။

ေနာက္တစ္ခုက MySQL ထဲက Database ကို သြားခ်ိတ္တာပါ။ mysql_select_db ဆိုတဲ့ function ကိုသံုးပါတယ္။ mysql_select_db ကို ေလ့လာခ်င္တယ္ ဆိုရင္ ဒီေနရာ မွာ ေလ့လာႏိုင္ပါတယ္။ အဓိက passing values ႏွစ္ခုကေတာ့ $database နဲ႔ $connect ပါ။ $database ကိုေတာ့ db.php မွာ သတ္မွတ္ေပးခဲ့ၿပီး ျဖစ္ပါတယ္။ $connect ကိုေတာ့ အေပၚက စာေၾကာင္းက ရမွာ ျဖစ္ပါတယ္။ အဲဒီေနရာမွာလည္း database ကို ခ်ိတ္မရရင္ Unable to connect to the database at this error ျပဦးမွာ ျဖစ္ပါတယ္။ အဲဒီအဆင့္ထိၿပီးသြားရင္ database ကို ခ်ိတ္ဆက္ၿပီး ျဖစ္ေစပါတယ္။ Database နဲ႔ ပတ္သက္တဲ့ အခ်က္အလက္ေတြကို index.php မွာ တစ္ေပါင္းတည္း ေရးလို႔ရေပမယ့္ ဖိုင္ခြဲၿပီး ေရးရျခင္း အေၾကာင္းအရင္းကေတာ့ Security အတြက္ ျဖစ္ပါတယ္။

Form မွ တစ္ဆင့္ အခ်က္အလက္ပို႔လြတ္ျခင္းမ်ားကို စစ္ေဆးျခင္း

ဒီအပိုင္းကေတာ့ အသံုးျပဳသူ User အေနနဲ႔ Form ကေန တစ္ဆင့္ အခ်က္အလက္ေတြကို ပို႔လား၊ မပို႔ဘူးလားဆိုတာကို စစ္ေဆးတာ ျဖစ္ပါတယ္။

// checks the POST to see if something has been submitted
if(isset($_POST['send'])) {
// are any of the fields empty? the || means 'or'
if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['post'])) {
echo('<p class="error">You did not fill in a required field.</p>');
} else {

if ဆိုတဲ့ statement နဲ႔ စစစ္ပါတယ္။ ပထမ send ျဖစ္မျဖစ္ စစ္ပါတယ္။ ဒုတိယ name, email, post စတာေတြကို စစ္ပါတယ္။ အဲဒီလို စစ္လို႔ တစ္ခုခုလိုေနရင္ You did not fill in a required field. ဆိုၿပီး Error ျပမွာ ျဖစ္ပါတယ္။ သံုးသြားတဲ့ function ေတြကေတာ့ isset နဲ႔ empty တို႔ ျဖစ္ပါတယ္။ ဆက္ေရးရမယ့္ အပုိင္းကေတာ့

// if there are no empty fields, insert into the database:

// escape special characters to stop xss and sql injecting
// we take the 'name' and 'post' parts from the POST
// and run it through htmlspecialchars()
// this stops users sending HTML code, as it could be malicious
//
// also runs through mysql_real_escape_string()
// stops users sending SQL code, which could be used to access the db
$name = htmlspecialchars(mysql_real_escape_string($_POST['name']));
$email = htmlspecialchars(mysql_real_escape_string($_POST['email']));
$post = htmlspecialchars(mysql_real_escape_string($_POST['post']));

// this is our SQL string to insert shouts into db
$sql = "INSERT INTO shouts SET name='$name', email='$email', post='$post', ipaddress='$ipaddress';";

// we run the SQL string now
// if it succeeds, display message
if (@mysql_query($sql)) {
echo('<p class="success">Thanks for shouting!</p>');
} else {
// if it errors, send message
echo('<p class="error">There was an unexpected error when posting your shout.</p>');
}
}
}

ပထမဦးဆံုး Line သံုးေၾကာင္းမွာေတာ့ htmlspecialchars(), mysql_real_escape_string() ဆိုတဲ့ function ႏွစ္ခုကို သံုးတာ ေတြ႔ရပါလိမ့္မယ္။ အဲဒီ function ႏွစ္ခုအတြက္ လိုအပ္တဲ့ Variable ေတြလည္း Passing လုပ္ေပးရပါတယ္။ တစ္ခုခ်င္းစီ ရွင္းျပရမယ္ဆိုရင္

htmlspecialchars() ကို အဓိကသံုးရျခင္း အေၾကာင္းအရင္းကေတာ့ HTML Code ေတြ ထည့္ၿပီး Submit မလုပ္ႏုိင္ေအာင္ ျဖစ္ပါတယ္။ အဲဒီလို မကာကြယ္ ထားတဲ့အခါ အျခားသူေတြ အေနနဲ႔ HTML Code ေတြကို ကိုယ့္ Database ထဲထည့္ၿပီး ေႏွာက္ယွက္ႏိုင္ပါတယ္။ ဒီထက္ပိုဆိုးတာက Javascript code ေတြ ထည့္ၿပီး အေႏွာက္အယွက္ ေပးတာပါပဲ။

mysql_real_escape_string() ကေတာ့ အေပၚက htmlspecialchars() နဲ႔ ဆင္ပါတယ္။ ဒါေပမယ့္သူကေတာ့ မလိုလားအပ္တဲ့ SQL Query ေတြလွမ္း မလုပ္ေအာင္ ရည္ရြယ္ပါတယ္။ တစ္ခုက HTML, Javascript ေတြကို တားတာ ျဖစ္ၿပီး ေနာက္တစ္ခုကေတာ့ SQL Query ေတြကို တားတာ ျဖစ္ပါတယ္။ SQL Injection လို႔ေခၚတဲ့ SQL ထဲကို ဝင္ၿပီး အခ်က္အလက္ေတြ ခိုးတာ အခ်က္အလက္ေတြ ဖ်က္တာ ျပင္တာေတြ ေရွာင္ရွားႏိုင္ဖို႔ ျဖစ္ပါတယ္။

ေနာက္ဆံုး အပိုင္းကေတာ့ SQL Query တစ္ခုကို ဖန္တီးၿပီး User ထည့္လိုက္တဲ့ အခ်က္အလက္ေတြကို Database ထဲ ထည့္တာ ျဖစ္ပါတယ္။ အကယ္၍ မွန္မွန္ကန္ကန္ ၿပီးသြားတယ္ဆိုရင္ Thanks for shouting! ဆိုျပီး ျပေပးမွာ ျဖစ္ေပမယ့္ တစ္ခုခုမွားေနရင္ေတာ့ There was an unexpected error when posting your shout. ဆိုၿပီး error ျပမွာ ျဖစ္ပါတယ္။

မူလရွိၿပီးသား အခ်က္အလက္မ်ား ျပန္ေခၚျခင္း

ဒီအပိုင္းမွာေတာ့ နဂိုရွိၿပီးသား Shout လုပ္ထားတဲ့ အခ်က္အလက္မ်ားကို ျပန္ေခၚမွာ ျဖစ္ပါတယ္။ အရင္ရွိၿပီးသား အခ်က္အလက္ထဲက ၈ ခုကိုျပန္ေခၚမွာ ျဖစ္ပါတယ္။

// now we retrieve the 8 latest shouts from the db
$query = "SELECT * FROM shouts ORDER BY `id` DESC LIMIT 8;";

// run the query. if it fails, display error
$result = @mysql_query("$query") or die('<p class="error">There was an unexpected error grabbing shouts from the database.</p>');

?><ul><?
// while we still have rows from the db, display them
while ($row = mysql_fetch_array($result)) {

$ename = stripslashes($row['name']);
$eemail = stripslashes($row['email']);
$epost = stripslashes($row['post']);

// Woop! We can use Gravatars aswell!!
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5(strtolower($eemail))."&size=70";

echo('<li><div class="meta"><img src="'.$grav_url.'" alt="Gravatar" /><p>'.$ename.'</p></div><div class="shout"><p>'.$epost.'</p></div></li>');

}
?></ul><?

?>

ပထမဦးဆံုး စာေၾကာင္းကေတာ့ $query ဆိုတဲ့ variable ထဲကို sql query string တစ္ခု ထည့္တာျဖစ္ပါတယ္။ ORDER BY DESC LIMIT 8 ဆိုတဲ့အတြက္ စီတဲ့အခါ id ေတြကို ေနာက္ဆံုးကေန ျပန္စီမယ္။ ရွစ္ခုပဲ လိုခ်င္တယ္ ဆိုတဲ့ အဓိပၸါယ္ သက္ေရာက္ပါတယ္။

ဒုတိယ စာေၾကာင္းမွာေတာ့ $result ဆိုတဲ့ variable ထဲကို @mysql_query() ဆိုတဲ့ function သံုးၿပီး MySQL ထဲက Data ေတြကို လွမ္းယူပါတယ္။ အဲဒီေနရာမွာ @ ထည့္ထားတာကေတာ့ Error Escaping လို႔ အဓိပၸါယ္ရပါတယ္။ function ေတြေရွ႕မွာ အဲဒီလို ထည့္ထားရင္ Error ေတြ ျပေနတာ ေရွာင္လို႔ ရပါတယ္။ အဲဒီ function မွာ $query ဆိုတဲ့ variable ကိုထည့္ေပးၿပီး အခ်က္အလက္ေတြကို Database က လွမ္းယူပါတယ္။ ယူလို႔ မရရင္ေတာ့ ထံုးစံအတုိင္း die ဆိုၿပီး error ျပပါတယ္။

stripslashes() ကေတာ့ mysql_real_escape_string() မွာ ထည့္ခြင့္ျပဳႏုိင္ေျခ ရွိခဲ့တဲ့ / \ တို႔ စတာေတြကို ဖယ္ရွားပစ္တာပါ။

$grav_url ကေတာ့ Gravatar ဆိုတဲ့ Site ကေန email address နဲ႔ ဆိုင္တဲ့ avatar ေတြကို ေခၚဖို႔ ျဖစ္ပါတယ္။

အဲဒါေတြ ၿပီးသြားၿပီး ဆိုရင္ေတာ့ echo ဆိုၿပီး output ျပန္ထုတ္ေပးပါတယ္။ အဲဒီလို output ထုတ္ေပးတဲ့ ေနရာမွာ Gravatar, Name နဲ႔ Shout ေတြ ပါလာမွာ ျဖစ္ပါတယ္။ ေရွ႕ဆက္ၿပီး သြားရမယ့္ အပိုင္းကေတာ့ User ေတြ ရိုက္ထည့္မယ့္ Shout ေတြကို ထည့္ဖို႔ ေနရာအတြက္ ျဖစ္ပါတယ္။

User Input အတြက္ Form

ဒီအပိုင္းမွာေတာ့ User အတြက္ Data ထည့္လို႔ရမယ့္ Form အပိုင္းမွာ ေရးရမယ့္ Script ကေတာ့

<!-- at the bottom of the page, we display our comment form -->
<form action="<?php $self ?>" method="post">
<h2>Shout!</h2>
<div class="fname"><label for="name"><p>Name:</p></label><input name="name" type="text" cols="20" /></div>
<div class="femail"><label for="email"><p>Email:</p></label><input name="email" type="text" cols="20" /></div>
<textarea name="post" rows="5" cols="40"></textarea>
<input name="send" type="hidden" />
<p><input type="submit" value="send" /></p>
</form>

</div><!--/content-->
<div id="boxbot"></div>

</div><!--/container-->

</body>
</html>

အေပၚဆံုးမွာ သတ္မွတ္ထားခဲ့တဲ့ Variable ျဖစ္တဲ့ $self ကို အခုမွာ ျပန္သံုးပါတယ္။ POST Method ကို အသံုးျပဳၿပီး Data ေတြကို ပို႔လြတ္ပါတယ္။ ေနာက္ဆံုးမွာေတာ့ HTML ေတြကို ျပန္ပိတ္မွာ ျဖစ္ပါတယ္။ ဒီအဆင့္ထိ ေရာက္ရင္ေတာ့ Run ၾကည့္ရင္ Run ၾကည့္လို႔ရပါၿပီ။ ဒါေပမယ့္ ဘာစတိုင္မွာ ထည့္မရေတာ့ ေျပာင္ႀကီး ျဖစ္ေနပါလိမ့္မယ္။

Shoutbox Plain

Styling

ေနာက္ဆံုးအပိုင္းျဖစ္တဲ့ Styling ဆိုတဲ့အပိုင္းမွာေတာ့ စတိုင္က်က်ေလး ျဖစ္သြားေအာင္ ျပင္မွာ ျဖစ္ပါတယ္။ အဲဒီအတြက္ images ဆိုတဲ့ folder ေလးတစ္ခု ေဆာက္လိုက္ပါ။ ၿပီးရင္ ေအာက္မွာ ေပးထားတဲ့ file ေတြကို ထည့္လိုက္ပါ။

* images

style.css ဆိုတဲ့ဖိုင္ကို အေစာပိုင္းကတည္း ေဆာက္ၿပီ ျဖစ္ပါတယ္။ အဲဒီအထဲကို ေအာက္မွာ ေပးထားတဲ့ CSS Code ကို ကူးထည့္လိုက္ပါ။

* {
margin: 0;
padding: 0;
}

body {
background: #323f66 top center url("images/back.png") no-repeat;
color: #ffffff;
font-family: Helvetica, Arial, Verdana, sans-serif;
}

h1 {
font-size: 3.5em;
letter-spacing: -1px;
background: url("images/shoutbox.png") no-repeat;
width: 303px;
margin: 0 auto;
text-indent: -9999em;
color: #33ccff;
}

h2 {
font-size: 2em;
letter-spacing: -1px;
background: url("images/shout.png") no-repeat;
width: 119px;
text-indent: -9999em;
color: #33ccff;
clear: both;
margin: 15px 0;
}

h5 a:link, h5 a:visited {
color: #ffffff;
text-decoration: none;
}

h5 a:hover, h5 a:active, h5 a:focus {
border-bottom: 1px solid #fff;
}

p {
font-size: 0.9em;
line-height: 1.3em;
font-family: Lucida Sans Unicode, Helvetica, Arial, Verdana, sans-serif;
}

p.error {
background-color: #603131;
border: 1px solid #5c2d2d;
width: 260px;
padding: 10px;
margin-bottom: 15px;
}

p.success {
background-color: #313d60;
border: 1px solid #2d395c;
width: 260px;
padding: 10px;
margin-bottom: 15px;
}

#container {
width: 664px;
margin: 20px auto;
text-align: center;
}

#boxtop {
margin: 30px auto 0px;
background: url("images/top.png") no-repeat;
width: 663px;
height: 23px;
}

#boxbot {
margin: 0px auto 30px;
background: url("images/bot.png") no-repeat;
width: 664px;
height: 25px;
}

#content {
margin: 0 auto;
width: 664px;
text-align: left;
background: url("images/bg.png") repeat-y;
padding: 15px 35px;
}

#content ul {
margin-left: 0;
margin-bottom: 15px;
}

#content ul li {
list-style: none;
clear: both;
padding-top: 30px;
}

#content ul li:first-child {
padding-top:0;
}

.meta {
width: 85px;
text-align: left;
float: left;
min-height: 110px;
font-weight: bold;
}

.meta img {
padding: 5px;
background-color: #313d60;
}

.meta p {
font-size: 0.8em;
}

.shout {
width: 500px;
float: left;
margin-left: 15px;
min-height: 110px;
padding-top: 5px;
}

form {
clear: both;
margin-top: 135px !important;
}

.fname, .femail {
width: 222px;
float: left;
}

form p {
font-weight: bold;
margin-bottom: 3px;
}

form textarea {
width: 365px;
overflow: hidden; /* removes vertical scrollbar in IE */
}

form input, form textarea {
background-color: #313d60;
border: 1px solid #2d395c;
color: #ffffff;
padding: 5px;
font-family: Lucida Sans Unicode, Helvetica, Arial, Verdana, sans-serif;
margin-bottom: 10px;
}

အဲဒီအဆင့္ၿပီးသြားရင္ေတာ့ ေအာက္မွာ ျပထားတဲ့အတုိင္း စတိုင္က်တဲ့ Shoutbox ေလးတစ္ခု ရလာမွာ ျဖစ္ပါတယ္။

Final Output

ဒီ Shoutbox မွာ Validation Check ေတြ အမ်ားႀကီး လုပ္ဖို႔ လိုေနပါေသးတယ္။ အဲဒီအပိုင္းေတြကို ေရွ႕ဆက္ေရးသြားပါ့မယ္။ အဲဒီအျပင္ Shout List ေတြကို ျပႏိုင္မယ္ admin panel တစ္ခုလည္း လိုဦးမွာ ျဖစ္ပါတယ္။ အဲဒီလို အဆင့္ဆင့္ေရးသြားဖို႔ စိတ္ကူးထားပါတယ္။ Source Code အျပည့္အစံု လိုခ်င္တယ္ ဆိုရင္ေတာ့

 
Forum » WEB DEVELOPMENT » PHP » ShoutBox with PHP and MySQL
  • Page 1 of 1
  • 1
Search:

Powered by uCoz