I have enclosed a form that I cannot get to post files. Using debugging, I have figured out that the post is going through, but not the files. Here is the code:
<font face=\"verdana\" size=\"2\"><br><br><form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">
<table width=\"600\" bgcolor=\"#EEEEEE\">
if (!isset($_SESSION['uploadcount'])){
$k = 1;
if (4 >= $numbers){
$i = $numbers;
}
if (4 < $numbers){
$i = 4;
}
while ($k <= $i){
echo"<tr><td align=\"left\" valign=\"top\">".$k."</td><td align=\"center\">".$_SESSION['title'][$k]."<input type=\"file\" size=\"40\" name=\"upload".$k."\"><br><br></td></tr>";
$k++;
}
No matter what I do I cannot get this form to submit even a small text file. I have used this same code to upload images to my site, but I can't get it to work now. When I put the following code at the top of the page for debugging to see if the post is being set it turns out like this:
if (isset($_POST['upload1'])){
echo "if this shows up the post is being set?";
}
The above line shows up, however if I try to use this code in place of the $_POST['upload1'], it doesn't work, which it needs to in order for files to be uploaded:
This doesn't work
if (isset($FILES['upload1'])){
echo "$FILES['upload1']['name'];
}
even when I send the form to another page instead of Php_self, the form only shows up as being posted not the file itself. Can anyone find an error in my syntax? Thanks a bunch.