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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.