PHP Abstract Podcast Episode 32: Introduction to symfony

Today’s special guest is Stefan Koopmanschap. Stefan is web application developer and professional services consultant for Ibuildings.nl. He is the initiator of the SymfonyCamp event in 2007, and is also trying to promote symfony in The Netherl...

Create Simple ShoutBox Print E-mail
User Rating: / 4
PoorBest 
Hi,this is simple tutorials to create shoutbox. [b]Step 1 :[/b] Create database with information :
CREATE TABLE `tagboard` (
`id` int(7) NOT NULL auto_increment,
`name` varchar(250) NOT NULL default '',
`comments` text NOT NULL,
`date` timestamp(14) NOT NULL,
PRIMARY KEY (`id`),
) TYPE=MyISAM AUTO_INCREMENT=419 ;

Step 2 : Create file config.php with content

$dbuser=""; //Database Username
$dbname=""; //Database Name
$dbpass=""; // Database Password
?>

Step 3: Create File tag.php with content :








Step 4: Create file todo.php with content :

if ($name == '' || $post == ''")
{
die ("Please fill all fields. Click here to return.");
}
include('config.php');

$post = preg_replace("/$post = preg_replace("/>/",">",$post);
$post = nl2br($post);
$comments = "$post";
}

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

} ?>

Step 5 :Finally,create file view.php with content :
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"];

?>
»" ; ?>
}?>

You're done.

About Author :
T4VN.NET is an online PHP Help community that provides PHP Tutorials, PHP Examples, PHP Scripts, PHP Support,coupon code for hosting,download free template.
Visit : http://www.t4vn.net you can get more information with PHP Code,PHP Example,Download free script,..
 
< Prev   Next >