PHP + HTML: create a form dynamically -


i'm trying creat form dynamically depending on number of rows of table in database. tried , it's nor working:

require_once('mysqli_connect.php');  //i select colum w_spanish table selected user $q="select w_spanish ".$_get['name'];  $r=@mysqli_query($dbc, $q);  echo '<form method="post" action="correction.php">'; echo '<table border="1">';  //here generate dinamically table can filled user while ($row=mysqli_fetch_array($r, mysqli_assoc)){  $aux=$row['w_spanish']; echo '<tr><td>'.$aux.'</td><td><input type="text" name="sol_'.$aux.'" size="20"></td></tr>';  }  echo '</table>'; echo '<p><input type="submit" value="submit" ></p></form>';    mysqli_close($dbc); 

so when press submit, information not sent "correction.php", , think it's because creating html form inside php code. how right??

first off - remove @ @mysqli statement masking errors maybe happening.

secondly take generated code , paste http://validator.w3.org/#validate_by_input , see if there html errors , adjust necessary.

thirdly, since user can select table read data needs super-sanitised don't want sql injection attacks here.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -