Hello.
This table is displayed in a loop.
<table> <tr> <td>текст 1</td> <td><iframe src="quare_05.php?id=1" class="if1"></iframe></td> </tr> <tr> <td>текст 2</td> <td><iframe src="quare_05.php?id=2" class="if1"></iframe></td> </tr> <tr> <td>текст 3</td> <td><iframe src="quare_05.php?id=3" class="if1"></iframe></td> </tr> <tr> <td>текст 4</td> <td><iframe src="quare_05.php?id=4" class="if1"></iframe></td> </tr> </table>
There is a page in which inside the table, inside the cells, iframe is loaded. iframe identifies the id and makes a request to mysql via the re.php page, which changes the desired cell from 0 to 1 or 1 to 0, then jumps back to quare_05.php and displays a yes / no button. The point is that without JS I can make inquiries to the database without reloading the page.
// вычисляем id $zapros = mysql_query("SELECT id,st FROM table ORDER BY id",$db); while($massiv = mysql_fetch_array($zapros)) { if($massiv["st"]==1) { echo "<form action=\"re.php\" method=\"post\"> <input type=\"hidden\" name=\"field0\" value=\"".$id."\"> <input type=\"hidden\" name=\"field1\" value=\"0\"> <input type=\"submit\" value=\"да\" class=\"blue\"> </form>"; } else { echo "<form action=\"re.php\" method=\"post\"> <input type=\"hidden\" name=\"field0\" value=\"".$id."\"> <input type=\"hidden\" name=\"field1\" value=\"1\"> <input type=\"submit\" value=\"нет\" class=\"oran\"> </form>"; } }
Is it possible to implement the above without an iframe, but using JS?