Hi...i would like to save and edit some excel files located in server using php. The coding below upload the file but when i open the page again...the message 'no file chosen' appears. Please help on this matter...thanks a lot...
<?php
error_reporting(E_ALL ^ E_NOTICE);
$_SESSION['Targetid'];
$_SESSION["Progressid"];
$conn = mysql_connect("localhost","pqa","");
mysql_select_db("pq",$conn);
if(count($_POST)>0) {
mysql_query("UPDATE progress set Attachment2='" . $_POST["Attachment2"] . "',
Attachment21='" . $_POST["Attachment21"] . "' WHERE Progressid='" . $_SESSION["Progressid"] . "'");
$message = "Record Modified Successfully";
}
$result = mysql_query("SELECT * FROM progress WHERE Progressid='" . $_SESSION["Progressid"] . "'");
$row= mysql_fetch_array($result);
?>
<html>
<head>
<title>Add New User</title>
<link rel="stylesheet" type="text/css" href="styles.css"/>
</head>
<body>
<form name="<?php echo $_SERVER['PHP_SELF']?>" method="post" action="">
<div style="width:500px;">
<div class="message"><?php if(isset($message)) { echo $message; } ?></div>
<div align="right" style="padding-bottom:5px;"><a href="list_progress2.php" class="link"><img alt='List' title='List' src='images/list.png' width='15px' height='15px'/> List Progress</a></div>
<p><b>1.Target</b></p>
<ENCTYPE="multipart/form-data">c.i.Preformatted Forms: <input type="file" name="Attachment2" MAXLENGTH=50 ALLOW="text/*" value="<?php echo $row['Attachment2']; ?>"><br>
<ENCTYPE="multipart/form-data">c.ii.School/Department Forms: <input type="file" name="Attachment21" MAXLENGTH=50 ALLOW="text/*" value="<?php echo $row['Attachment21']; ?>"><br>
<input type="hidden" name="Targetid" ><br>
<td colspan="2"><input type="submit" name="submit" value="Submit" class="btnSubmit"></td>
</div>
</form>
</body></html>