Hi..
i'm basically a novice in php and have been trying to work out on a multiplication tables using textboxes (to arrive at the square of each number using loops). Given below is the code. Herein i'm not sure as to how to define the variable component which needs to change for each value in the loop.
The code
<?php
// Loop through actions for count
$eg_i = 1;
for(; $eg_i < 11; $eg_i++)
{
}
$eg_calc_1 = @( $_POST['1Text"<?php echo $eg_i ?>"'] * $_POST['2Text"<?php echo $eg_i ?>"']);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form id="Form1" style="WIDTH: 100%; HEIGHT: 143px" action="<?php echo $_SERVER['PHP_SELF'].(@($_SERVER['QUERY_STRING'] > ' ') ? '?'.$_SERVER['QUERY_STRING'] : '') ?>" method="post">
<?php
// Loop through elements for count
$eg_i = 1;
for(; $eg_i < 11; $eg_i++)
{
?>
<p>
<input id="1Text<?php echo $eg_i ?>" value="<?php echo $eg_i ?>" name="1Text<?php echo $eg_i ?>"> x
<input id="2Text<?php echo $eg_i ?>" value="<?php echo $eg_i ?>" name="2Text<?php echo $eg_i ?>"> = <span id="span1"><?php echo $eg_calc_1 ?></span>
</p>
<?php
}
?>
<p>
</p>
<p>
<input id="Submit1" type="submit" value="Submit Form" name="Submit1">
</p>
</form>
</body>
</html>
I would be really grateful if you can assist me in solving this problem.
Regards
Vijay