Taking Creativity To A New Level
 
HomePortalInhouse AnimationsDownloadsLog inMemberlistSearchUsergroupsRegisterLinks

Share | 
 

 Create file add_topic.php

Go down 
AuthorMessage
ajaybali
Starting Activeness
Starting Activeness
avatar

Posts : 3
Join date : 2010-05-03

PostSubject: Create file add_topic.php   Mon May 03, 2010 4:07 am

############### Code

<?php
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="forum_question"; // Table name

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

// get data that sent from form
$topic=$_POST['topic'];
$detail=$_POST['detail'];
$name=$_POST['name'];
$email=$_POST['email'];

$datetime=date("d/m/y h:i:s"); //create date time

$sql="INSERT INTO $tbl_name(topic, detail, name, email, datetime)VALUES('$topic', '$detail', '$name', '$email', '$datetime')";
$result=mysql_query($sql);

if($result){
echo "Successful<BR>";
echo "<a href=main_forum.php>View your topic</a>";
}
else {
echo "ERROR";
}
mysql_close();
?>

________________________________________




n methyl d aspartate
4life transfer factor
Back to top Go down
View user profile
 
Create file add_topic.php
Back to top 
Page 1 of 1
 Similar topics
-
» How To Create Clickable Links
» CREATE YOUR OWN PONY
» Did Victor Surge Actually Create Slender man
» Fusing trunks to create a clump?
» Create A Creepypasta!

Permissions in this forum:You cannot reply to topics in this forum
Flash-Revival :: Creativity :: Tutorials-
Jump to: