Jump to content

Forms + While Loops


supanoob

Recommended Posts

<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<table border="0" width="7%" id="table1" cellspacing="0" cellpadding="0">
	<tr>
		<td>5</td>
		<td background="http://www.porkyproductions.com/images/map/water.gif">
		<input type="radio" value="V1" name="R1" checked></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V2" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V3" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V4" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V5" name="R1"></td>
	</tr>
	<tr>
		<td>4</td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V16" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V17" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V18" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V19" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V6" name="R1"></td>
	</tr>
	<tr>
		<td background="http://www.porkyproductions.com/images/map/water.gif">3</td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V15" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V22" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V21" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V20" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V7" name="R1"></td>
	</tr>
	<tr>
		<td>2</td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V14" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V23" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V24" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V25" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V8" name="R1"></td>
	</tr>
	<tr>
		<td>1</td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V13" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V12" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V11" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V10" name="R1"></td>
		<td background="http://www.porkyproductions.com/images/map/water.gif"><input type="radio" value="V9" name="R1"></td>
	</tr>
	<tr>
		<td align="center"> </td>
		<td align="center">1</td>
		<td align="center">2</td>
		<td align="center">3</td>
		<td align="center">4</td>
		<td align="center">5</td>
	</tr>
</table>
<p><input type="submit" value="Submit" name="B1"></p>
</form>

 

thats pretty much it. Basically it will be a fishing thing but the fish will move and you have to guess where they have moved too.

Link to comment
https://forums.phpfreaks.com/topic/72510-forms-while-loops/#findComment-365632
Share on other sites

so how would i know which part of the grid it is? i was planning on changing the R1 to the Coords on the 5x5 grid. So i would need a loop right? the coords would be like

 

11 | 21 | 31 | 41 | 51

12 | 22 | 32 | 42 | 51

 

etc etc

 

then i would need to do a loop to see which one matchs the number in the db.

Link to comment
https://forums.phpfreaks.com/topic/72510-forms-while-loops/#findComment-365642
Share on other sites

You have all the grids values labeled from v1-v24 which will be stored in the $_POST['R1'] variable. So you will know which part of the grid is selected because they all have different values. Now you would just do a query based on that to see if it matches the one in the database or whatever.

 

If that isn't what your trying to do, you need to explain a little more.

 

Link to comment
https://forums.phpfreaks.com/topic/72510-forms-while-loops/#findComment-365807
Share on other sites

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.