upload file problem
Moderator: General Moderators
-
mikotondria
- Forum Newbie
- Posts: 11
- Joined: Thu Jun 24, 2004 5:20 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
you have a for loop.. which covers:
Code: Select all
<?php
for ($i=0; $i<$num_results; $i++)
{
$row = mysql_fetch_array($result);
if ( is_int($i/2)){
echo "<tr bgcolor=#e0e0e0>";
} else {
echo "<tr>";
}
echo "<td valign=top>";
echo "<span>";
echo "<input type"text" name="title" class="dates" size="20" value="".htmlspecialchars(stripslashes($row['title']))."">";
echo "</input>";
echo "</span>";
echo "</td>";
echo "<td width=250 valign=top>";
echo "<span>";
echo "<textarea name="description" class="description2" rows=10 cols=50>";
echo htmlspecialchars(stripslashes($row['description']));
echo "</textarea>";
echo "</span>";
echo "</td>";
echo "<input type="hidden" name="image" value="".htmlspecialchars(stripslashes($row['photo_url']))."">";
echo "<input type="hidden" name="entry" value="".htmlspecialchars(stripslashes($row['entry_id']))."">";
echo "<td valign=top>";
echo "<span class="img2"><img src="images/".htmlspecialchars(stripslashes($row['photo_url']))."" height=100 width=100 <br><br>
<input type="hidden" name="MAX_FILE_SIZE" value="100000"/><p>
<input class="artist" type="file" name="image1" size="25" />"; // HERE
echo "</td>";
echo "<td valign=top>";
echo "<span class="img2"><img src="images/".htmlspecialchars(stripslashes($row['photo_url2']))."" height=80 width=80 <br><br>
<input type="hidden" name="MAX_FILE_SIZE" value="100000"/><p>
<input class="artist" type="file" name="image1" size="25" />"; // HERE
echo "</td>";
echo "</tr><tr align=right><td colspan=7><input type="submit" value="Update"/>";
echo "</table>";
echo "</form>";
}
?>-
mikotondria
- Forum Newbie
- Posts: 11
- Joined: Thu Jun 24, 2004 5:20 pm
OK, cool - I closed the img tags, like so...
regarding the loop, I suppose its unnecessary, since I am only retirieving one record, right... ?
shall I just replace that with $i =0; ?
a thousand thanks,
Mike.
Code: Select all
<?php
echo "<td valign=top>";
echo "<span class="img2"><img src="images/".htmlspecialchars(stripslashes($row['photo_url']))."" height=100 width=100> <br><br><input class="artist" type="file" name="image1" size="25" />";
echo "</td>";
echo "<td valign=top>";
echo "<span class="img2"><img src="images/".htmlspecialchars(stripslashes($row['photo_url2']))."" height=80 width=80> <br><br>
<p>
<input class="artist" type="file" name="image1" size="25" />";
echo "</td>";
?>shall I just replace that with $i =0; ?
a thousand thanks,
Mike.
-
mikotondria
- Forum Newbie
- Posts: 11
- Joined: Thu Jun 24, 2004 5:20 pm
ah, very sharp eyes there, thanks
..
Looking more hopeful now, with output being
array(2) { ["image1"]=> array(4) { ["name"]=> string(12) "scan1_tn.jpg" ["type"]=> string(11) "image/pjpeg" ["tmp_name"]=> string(14) "/tmp/php8MsV8u" ["size"]=> int(2872) } ["image2"]=> array(4) { ["name"]=> string(0) "" ["type"]=> string(24) "application/octet-stream" ["tmp_name"]=> string(4) "none" ["size"]=> int(0) } } file 1 isfile 2 is
so its receiving the image, and in the error dump is showing the 'name' part of the array as being present...
Its not echoing that when I set $nameit1 to $_FILES['image1']['name'], though, as evidenced by the '..file 1 is' being blank..
Still, this seems like progress, thank you
..
Looking more hopeful now, with output being
array(2) { ["image1"]=> array(4) { ["name"]=> string(12) "scan1_tn.jpg" ["type"]=> string(11) "image/pjpeg" ["tmp_name"]=> string(14) "/tmp/php8MsV8u" ["size"]=> int(2872) } ["image2"]=> array(4) { ["name"]=> string(0) "" ["type"]=> string(24) "application/octet-stream" ["tmp_name"]=> string(4) "none" ["size"]=> int(0) } } file 1 isfile 2 is
so its receiving the image, and in the error dump is showing the 'name' part of the array as being present...
Its not echoing that when I set $nameit1 to $_FILES['image1']['name'], though, as evidenced by the '..file 1 is' being blank..
Still, this seems like progress, thank you
-
mikotondria
- Forum Newbie
- Posts: 11
- Joined: Thu Jun 24, 2004 5:20 pm