I maintain our company website and we had upgraded our web server to a VPS plan from our previous shared plan so that we could install a specific search engine. While this worked fine and we got what we wanted, we also got newer / updated versions of some of the other software on the server i.e. newer Apache, MySql and PHP. The end result was that a number of things that worked before became "broken", the biggest problem was that on the previous version all PHP variables had been global and now everything was made local. While I believe this is an option on the server that could be set back to the old settings prevailing opinion seems to be that for security this is a better option. I mention all of this just so that you can understand the history of this problem.
Within the content management portion of out site there are several pages where you can add / edit / delete data from the MySql database. All of these pages use the HTML FORM element and various input fields. In several of the pages there are fields that use the "file" type field to specify images files to be upload to the site. The problem is that all the fields are properly passing back their values to the page specified in "action" with the exception of these "file" fields. As far as my testing goes once the "submit" button is pressed and control passes to the pages specified the value of these file fields is blank while all the other fields have the values that were input on the previous page. Here's a snipit of code from the page that I'm trying to fix:
As you can see the enctype is correct and the fact that the other fields work and the file fields don't is really driving me a little crazy. Does anyone have an idea why these particular fields are not passing their values back?
Within the content management portion of out site there are several pages where you can add / edit / delete data from the MySql database. All of these pages use the HTML FORM element and various input fields. In several of the pages there are fields that use the "file" type field to specify images files to be upload to the site. The problem is that all the fields are properly passing back their values to the page specified in "action" with the exception of these "file" fields. As far as my testing goes once the "submit" button is pressed and control passes to the pages specified the value of these file fields is blank while all the other fields have the values that were input on the previous page. Here's a snipit of code from the page that I'm trying to fix:
Code:
<form action="index.html" method="post" enctype="multipart/form-data" >
<input type="hidden" name="table" value="<? echo "njhs_".$tablename ?>">
<input type="hidden" name="recid" value="<? echo $_GET["recid"] ?>">
<input type="hidden" name="action" value="updatedb">
<input type="hidden" name=assetPath value = "/home/webadmin/mywebsite/html/assets">
<h2><? echo $PageTitle ?></h2>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
Title:
</td>
<td colspan="2">
<input type="text" size=100 name="sf[title]" value="<? echo $RowDat["title"] ?>">
</td>
</tr>
<tr>
<td>
Small Image:
</td>
<td valign="middle">
<input type="file" name="upfile_small" size = "80">
</td>
<?
if ($_GET["recid"]) {
echo "<td valign=\"middle\"><font size=\"2\">Current Image:</font><br><img src=\"../assets/njhs_exhibits/small_image_file/" . $RowDat["small_image_file"] . "\"></td>\n";
} else {
echo "<td> </td>\n";
}
?>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td valign="middle">
Large Image:
</td>
<td>
<input type="file" name="upfile_large" size = "80">
</td>
<?
if ($_GET["recid"]) {
echo "<td valign=\"middle\"><font size=\"2\">Current Image:</font><br><img src=\"../assets/njhs_exhibits/large_image_file/" . $RowDat["large_image_file"] . "\"></td>\n";
} else {
echo "<td> </td>\n";
}
?>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
</table>
</form>
As you can see the enctype is correct and the fact that the other fields work and the file fields don't is really driving me a little crazy. Does anyone have an idea why these particular fields are not passing their values back?