I am a newbie to PHP.
I have been trying to get a picture list going, based on contents of a directory (filesystem) 😃 (now don't tell me there is enough code out there that does this trick; this is a deliberate action to learn PHP)
I get the code to work in Mozilla browsers. The code even validates thoroughly on the validation tools from W3C, but I just cannot get a succesfull post in IE nor in Opera. It looks as if the submission in those browsers does not post anything (except for the coordinates of the clicked input variable). Debugging the code does not help me any further either.
Below I have included my code.
<?php
if (!IsSet($_POST['Submit'])) {
$Sel_Pict="";
}
else {
$Sel_Pict = $_POST['Submit'];
}
?>
<body>
<table border="0" cellspacing="0" cellpadding="2" summary="pictures" width="598">
<tr>
<td width="500">
<?php
$Sel_Pic = substr($Sel_Pict, 1, 7);
if (IsSet($Sel_Pic)) {
print("<div><img src=\"$PathToPics$Sel_Pic\" alt=\"$Sel_Pic\" align=\"top\" title=\"$Sel_Pic\" border=\"1\" ></div>");
}
?>
<br>
<br>
<br>
</td>
<td>
<table>
<tr>
<td>
<form name="pictureForm" method="post" action="..<?php echo $_SERVER['PHP_SELF']; ?>">
<?php
$Open=opendir("$PathToThumbs");
While ($Files=readdir($Open)) {
if(strstr(strtolower($Files),".jpg") || strstr(strtolower($Files),".gif")) {
print("<input type=\"image\" name=\"Submit\" onclick=\"document.forms['pictureForm'].submit()\" src=\"$PathToThumbs$Files\" value=\"P$Files\" id=\"P$Files\"><br>");
}
}
?>
</form>
</td>
</tr>
</table>
</table>
</body>
Does anyone have suggestions?