but I can not figure out how to increment the variables.
This what I have so far is
The short code
Code: Select all
for ($i = 1; $i <= 6; $i++) {
echo "
<tr>
<td>$Short1</td>
<td>$Name1</td>
<td>$Description1</td>
<td><form action='editattrib.php' method='post'>
<input name='token' type='hidden' value='".$_SESSION['token']."'/>
<input name='attribnum' type='hidden' value='".$i."'/>
<input name='submit' type='submit' value='EDIT'/>
</form></td>
</tr>
}
I need to increment the variables $Short1, $Name1, and $Description1.
The long code :
Code: Select all
echo "
<tr>
<td>$Short1</td>
<td>$Name1</td>
<td>$Description1</td>
<td><form action='editattrib.php' method='post'>
<input name='token' type='hidden' value='".$_SESSION['token']."'/>
<input name='attribnum' type='hidden' value='1'/>
<input name='submit' type='submit' value='EDIT'/>
</form></td>
</tr>
<tr>
<td>$Short2</td>
<td>$Name2</td>
<td>$Description1</td>
<td><form action='editattrib.php' method='post'>
<input name='token' type='hidden' value='".$_SESSION['token']."'/>
<input name='attribnum' type='hidden' value='2'/>
<input name='submit' type='submit' value='EDIT'/>
</form></td>
</tr>
<tr>
<td>$Short3</td>
<td>$Name3</td>
<td>$Description3</td>
<td><form action='editattrib.php' method='post'>
<input name='token' type='hidden' value='".$_SESSION['token']."'/>
<input name='attribnum' type='hidden' value='3'/>
<input name='submit' type='submit' value='EDIT'/>
</form></td>
</tr>
<tr>
<td>$Short4</td>
<td>$Name4</td>
<td>$Description3</td>
<td><form action='editattrib.php' method='post'>
<input name='token' type='hidden' value='".$_SESSION['token']."'/>
<input name='attribnum' type='hidden' value='4'/>
<input name='submit' type='submit' value='EDIT'/>
</form></td>
</tr>
<tr>
<td>$Short5</td>
<td>$Name6</td>
<td>$Description3</td>
<td><form action='editattrib.php' method='post'>
<input name='token' type='hidden' value='".$_SESSION['token']."'/>
<input name='attribnum' type='hidden' value='5'/>
<input name='submit' type='submit' value='EDIT'/>
</form></td>
</tr>
<tr>
<td>$Short5</td>
<td>$Name6</td>
<td>$Description3</td>
<td><form action='editattrib.php' method='post'>
<input name='token' type='hidden' value='".$_SESSION['token']."'/>
<input name='attribnum' type='hidden' value='6'/>
<input name='submit' type='submit' value='EDIT'/>
</form></td>
</tr>
";
cheers