not being able to decrement numbers via user input

I am trying to be able to have the numbers in the rows(columns) to be able to either increment or decrement via user input by radio button on the HTML form page.I have included both the HTML page and the PHP page.

HTML Code:

<html>
<head>
    <title>form</title>
    <style type="text/css">
body {background-color:yellow}
</style>
   
</head>
<body>
<form name="input" action="formout.php" method="post">
number of rows: <input type="text" name="rows" />
number of cells: <input type="text" name="cells" /></br>
Beginning Number: <input type="text" name="beginning" />&nbsp;
Ending Number: <input type="text" name="ending" /><br />
<input type="radio" name="count" value="up" /> Up<br />
<input type="radio" name="count" value="down" /> Down<br />
Skip Number: <input type="text" name="skip" /><br />
<input type="submit" value="Submit" />
</form>
</body>
</html>


PHP Code:


<?php
$rows_incoming
=$_POST['rows'] ;
$cells_incoming=$_POST['cells'] ;
$count_start=$_POST['beginning'];
$count_end=$_POST['ending'];
$skip=$_POST['skip'];
$across_start=$_POST['across'];
$across_end=$_POST['toacross'];
$count_up=$_POST['up'];
$count_down=$_POST['down'];

echo "<table  border=1 width=100%>";
$starting_integer=0;
for(
$rows=1;$rows<=$rows_incoming;$rows++){
    echo 
"<tr>";
    for(
$cells=1;$cells<=$cells_incoming;$cells++){
        echo 
"<td>";
        for (
$count=$count_start+$starting_integer $count<=$count_end+$starting_integer $count++) {
        
        elseif
            (
$count=$count_up+$starting_integer $count>=$count_down+$starting_integer $count--) {
            else
                (
$count%$skip)
                    echo 
"<br />" $count "<br />" ;
            }
        }
        echo 
"</td>";
        
    }
    echo 
"</tr>";
}
echo 
"</table>";
?>


any help would be appreciated.

View full post on Tycoon Talk

, , , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved