Seriously? You're talking to the wrong people, experienced PHP programmers will tell you right away that its the asterisks you have on those lines. I'm not trying to be rude on that, its just curious how nobody else would have noticed. I've removed them, reformatted and fixed a couple of other errors that I believe were damaged from the formatting since they appear fine here. There was one asterisks I left for the $j*$k, since I didn't know if you needed to keep it or not:
Originally Posted by puglover
$rowcolors = array ("purple", "red", "yellow", "orange", "blue", "pink");
background: <?php echo $_GET[ 'color' ];
Create a multiplication table
<form method="get" action="<?php $_SERVER['SCRIPT_NAME'];?> ">Enter number
of rows<br />
<input type="text" name="rownum" size="10"
value="<?php echo $_GET['rownum'];?>">
<p>Enter number of columns<br />
<input type="text" name="colnum" size="10"
value="<?php echo $_GET['colnum'];?>">
<p>Select a color<br />
<select name="color" value="<?php echo $_GET['color'];?>">
for ( $i = 0; $i < count( $rowcolors ); $i++ )
echo "<option value=\"" . $rowcolors[$i] . "\">" . $rowcolors[$i] . "</option>\n";
</select> <input type="hidden" name="do_php" value="true">
<p><input type="submit" value="Create Table">
echo "<table width=\"50%\" border=\"3\">";
echo "<tr class=\"rowcolor\">";
I just removed some more asterisks inside of the html that I came across. I'm assuming that was a copy/paste and the asterisks were representing spaces. I'm not certain how that came about otherwise.
I also changed the PHP_SELF (which was incorrect with php_self) to SCRIPT_NAME - PHP_SELF is XSS exploitable, so it should be avoided.
I think that gets them all.
Also, I should mention this since its clearly an assignment based off of you're file name, this help will likely not be constituted as cheating - I mearly removed the *'s for you and changed the PHP_SELF explaining why it should not be used. It is highly probable that you're instructor can find this posting online otherwise, so I thought I'd better mention that for you're benefit.