hello,
I'm trying to insert records into a table through a form.After the record is inserted, it shows me the mesg "Topic is inserted".
How can i show the mesg in the same form, so that the user can enter another record into the table without pressing back button or any other best solution.
Thank you
<?php
$location = "localhost";
$username = "root";
$password = "";
$database = "mydatabase";
$conn=mysql_connect($location, $username, $password)
or die ("Unable to connect");
mysql_select_db($database, $conn)
or die ("Unable to select database");
?>
<HTML>
<?php
if($submit)
{
$sql = "INSERT INTO themes (THEME_NAME) VALUES ('$topic')";
$result = mysql_query($sql);
echo "Topic is inserted.\n";
}
else
{
?>
<form method="post" action="inserthemes.php">
<p><b><font face="Verdana">To Insert themes into the database</font></b></p>
<p><font face="Arial">Thema:</font> <input type="text" name="topic" size="30"></p>
<input type="Submit"name="submit" value=" Insert thema"></form>
<?
}
?>
</HTML>