Hi uddin,
PHP with MYSQL is a good combination when compared to others.
- Code: Select all
<?php
ob_start();
}
<html>
<body>
<form name = frm action = <?php echo $_SERVER['PHP_SELF']; ?> method = "post">
Employee number: <input type = text name = empno> <br>
Employee Name : <input type = text name = empname> <br>
<input type = submit value = "save">
</form>
</body>
</html>
<?php
$con = @mysql_connect("localhost", "username","password") or die(mysql_error());
$db = @mysql_select_db("emp",$con) or die(mysql_error());
if(isset($_POST['empno'] or isset($_POST['empname']))
{
$qry = "insert into empdet (empno, empname) values (".$_POST['empno'].", '".$_POST['empname']."')";
$res = @mysql_query($qry) or die(mysql_error());
If($res>0)
{
header("location:success.php");
}
}
@mysql_close($con);
ob_end_flush();
?>
Use the code above or modify as needed.
Thanks!!!
_________________________________________
www.realmetrics.com - Metrics you can count on