| Current Path : /var/www/html/venkat/course/copyright/ |
| Current File : /var/www/html/venkat/course/copyright/copyupload.php |
<?php
mysql_connect("localhost","root","") or die(mysql_error());
mysql_selectdb("upload") or die(mysql_error());
$uploaddir = "c:/xampp/htdocs/copyright/";
$uploadfile = basename($_FILES[1]['name']);
$uploadfile = str_replace(" ", "_", $uploadfile);
$p=$uploadfile;
$uploadfile = $uploaddir.$uploadfile;
//echo $p;
$pp=$p;
$pp = str_replace(".", "", $pp);
$pp.="para.text";
$pt=$p;
$pt = str_replace(".", "", $pt);
$pt.="tc.text";
//echo $pp;
//echo $pt;
if (move_uploaded_file($_FILES[1]['tmp_name'], $uploadfile))
{
echo("<font color='red'>");
$s=exec("java ReadDocFile $p $pp $pt",$output);
echo $s;
$query ="insert into copyright(rollno,percentage) VALUES ('$p','$s')";
mysql_query($query) or die(mysql_error());
mysql_insert_id();
echo("</font>");
}
?>
<body >
<center>
<table width="60%" border="0" cellpadding="0" cellspacing="0">
<td >
<center>
<h4>
<h4>
IAM
</h4>
<h3>
Assignment Submission
<br>
</h3>
</center>
</td>
</tr>
<center>
<form enctype="multipart/form-data" action="copyupload.php" method="POST">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="checklogin.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td width=25%>Upload the Doc file</td>
<td>:</td>
<td>
<div id="fields">
<input type="hidden" name="MAX_FILE_SIZE" value="20512000" />
<input name="1" type="file" id="add1"/>
</div>
</div>
</td>
</tr>
<tr>
<tr>
<td width="25"><br><input type="submit" value="Send File"/></td>
</tr>
</table>
</td>
</form>
</tr>
</table>