<?php
//include_once('dbinfo.php');
$dbuser = 'root';
$dbhost = 'localhost';
$dbpwd = 'root';
$dbname = 'automation_system';
$suppress = $HTTP_GET_VARS['suppress'];
$id = $HTTP_POST_VARS['id'];
$course_id = $HTTP_POST_VARS['course_id'];
$semester_id = $HTTP_POST_VARS['semester_id'];
$teacher_id = $HTTP_POST_VARS['teacher_id'];
$test_id = $HTTP_POST_VARS['test_id'];
$marks = $HTTP_POST_VARS['marks'];
if (!empty($id)){
$dblink = mysql_connect($dbhost,$dbuser,$dbpwd) or die("Cannot Connect To Database");
mysql_select_db($dbname);
$query = "INSERT INTO classtest (id,course_id,semester_id,teacher_id,test_id,marks) VALUES ( '$id','$course_id','$semester_id','$teacher_id','$test_id','$marks' )";
$result = mysql_query($query, $dblink);
echo ('<p align = "left">Record Successfully Inserted</p>');
}
else if(empty($id) && (count($HTTP_POST_VARS)>0))
echo ('<p align = "left">Record Contains Error, Please Check Again</p>');
?>
<HTML>
<HEAD><link href='style.css' rel='stylesheet' type='text/css'>
</HEAD>
<style type="text/css">
<!--
body {
background-color: #e4eaf2;
}
-->
</style>
<BODY>
<BR>
<FORM name = 'form1' method = 'POST' action = ''>
<table width='100%' border='0' cellspacing='0' cellpadding='1'>
<TR>
<TD class='row4'> <div align='left'><span class='postdetails'>
<B> id</B>
</span></div></TD>
<TD class='row4'> <div align='left'><span class='postdetails'>
<input type ='text' name = 'id' size = '15' maxlength = '10' value = "<? echo $id; ?>">
</span></div></TD>
</TR>
<TR>
<TD class='row4'> <div align='left'><span class='postdetails'>
<B> course_id</B>
</span></div></TD>
<TD class='row4'> <div align='left'><span class='postdetails'>
<input type ='text' name = 'course_id' size = '15' maxlength = '10' value = "<? echo $course_id; ?>">
</span></div></TD>
</TR>
<TR>
<TD class='row4'> <div align='left'><span class='postdetails'>
<B> semester_id</B>
</span></div></TD>
<TD class='row4'> <div align='left'><span class='postdetails'>
<input type ='text' name = 'semester_id' size = '15' maxlength = '10' value = "<? echo $semester_id; ?>">
</span></div></TD>
</TR>
<TR>
<TD class='row4'> <div align='left'><span class='postdetails'>
<B> teacher_id</B>
</span></div></TD>
<TD class='row4'> <div align='left'><span class='postdetails'>
<input type ='text' name = 'teacher_id' size = '15' maxlength = '10' value = "<? echo $teacher_id; ?>">
</span></div></TD>
</TR>
<TR>
<TD class='row4'> <div align='left'><span class='postdetails'>
<B> test_id</B>
</span></div></TD>
<TD class='row4'> <div align='left'><span class='postdetails'>
<input type ='text' name = 'test_id' size = '15' maxlength = '10' value = "<? echo $test_id; ?>">
</span></div></TD>
</TR>
<TR>
<TD class='row4'> <div align='left'><span class='postdetails'>
<B> marks</B>
</span></div></TD>
<TD class='row4'> <div align='left'><span class='postdetails'>
<input type ='text' name = 'marks' size = '15' maxlength = '10' value = "<? echo $marks; ?>">
</span></div></TD>
</TR>
<TR>
<TD class='darkrow3'> <div align='left'><span class='postdetails'>
<B> Submit</B>
</span></div></TD>
<TD class='darkrow3'> <div align='left'><span class='postdetails'><input type = 'submit' value = 'submit data'></span></div></TD>
</TABLE></FORM> |