Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<html>
<head>
<script type="text/javascript">
function check(checkboxid) {
document.getElementById(checkboxid).checked = "checked";
}
</script>
</head>
<body>
<img src="YOUR_IMAGE" onclick="javascript:check('checkbox');">
<input type="checkbox" id="checkbox" />
</body>
</html>
<form action="<?=$PHP_SELF?>" method="post">
<?php
$result = mysql_query("SELECT id, image_time, title FROM {$table} ORDER BY id DESC");
if (mysql_num_rows($result) == 0) // table is empty
echo '<ul><li>No images loaded</li></ul>';
else
{
echo '<table width="800" border="0"><tr>';
while(list($id, $image_time, $title) = mysql_fetch_row($result))
{
echo "<td valign='bottom'>
<img src='{$PHP_SELF}?show={$id}' width='150px' height='100px' onclick='javascript:check('checkbox');'> <input type='checkbox' id='checkbox' name='del' value='{$id}'/>
</td>";
}
echo ' </tr></table>';
echo '<input type="hidden" value="Delete">';
}
?>
</form>
javascript:check('checkbox".$i."');
checkbox".$i."
echo '<table width="800" border="0"><tr>';
while(list($id, $image_time, $title) = mysql_fetch_row($result))
$i=0;
{
$i++;
echo "<td valign='bottom'>
<img src='{$PHP_SELF}?show={$id}' width='150px' height='100px' onclick='javascript:check(\"checkbox'.$i.'\")'> <input type='checkbox' id='checkbox\".$i.\"' name='del' value='{$id}'/>
</td>";
}
echo ' </tr></table>';
echo '<input type="hidden" value="Delete">';
vasilev каза:много кавички стават и май от там идва проблемът , но не мога да го подкарам нещо :
Код:echo '<table width="800" border="0"><tr>'; while(list($id, $image_time, $title) = mysql_fetch_row($result)) $i=0; { $i++; echo "<td valign='bottom'> <img src='{$PHP_SELF}?show={$id}' width='150px' height='100px' onclick='javascript:check("checkbox'.$i.'")'> <input type='checkbox' id='checkbox".$i."' name='del' value='{$id}'/> </td>"; } echo ' </tr></table>'; echo '<input type="hidden" value="Delete">';
иначе това което ми даде работи .