Jump to content

[SOLVED] tables, permissions, and uploads


Asday

Recommended Posts

<table border="3" width="100%">
<tr>
  <td align="center">
   <form action="gallery.php" method="post"
   enctype="multipart/form-data">
   <input type="file" name="file" id="file" />
   <input type="submit" name="submit" value="Post!" />
  </td>
</tr>
<tr>
<?php
echo '<td align="center">Browse for a picture here, or alternatively, type in the URL, and click the appropriate button to upload the said picture.</td>';
?>
</tr>
</table><br />
<table border="1" width="100%">
<tr>

<?php

$i=0;
foreach(scandir("upld194") as $x)
{
if ($i == "2")
{
	echo '</tr><tr>';
	echo '<td><a href="upld194/' . $x . '>' . $x . '</a></td>';
	$i = 0;
}
else
{
	echo '<td><a href="upld194/' . $x . '>' . $x . '</a></td>';
	$i++;
}
}
?>
</tr>

</table>

 

On all but the last file link, it comes out with the wrong link, with a suffix of lots of percent signs, and other such nonsense.

 

Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/60566-solved-tables-permissions-and-uploads/
Share on other sites

<table border="3" width="100%">
<tr>
  <td align="center">
   <form action="gallery.php" method="post"
   enctype="multipart/form-data">
   <input type="file" name="file" id="file" />
   <input type="submit" name="submit" value="Post!" />
  </td>
</tr>
<tr>
<?php
echo '<td align="center">Browse for a picture here, or alternatively, type in the URL, and click the appropriate button to upload the said picture.</td>';
?>
</tr>
</table><br />
<table border="1" width="100%">
<tr>

<?php

$i=0;
foreach(scandir("upld194") as $x)
{
if ($i == "2")
{
	echo '</tr><tr>';
	echo '<td><a href="upld194/' . $x . '">' . $x . '</a></td>';
	$i = 0;
}
else
{
	echo '<td><a href="upld194/' . $x . '">' . $x . '</a></td>';
	$i++;
}
}
?>
</tr>

</table>

 

On all but the last file link, it comes out with the wrong link, with a suffix of lots of percent signs, and other such nonsense.

 

Any help would be appreciated.

 

Haha, fixed it.

 

Missed a ".

 

Code fixed.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.